@@ -506,7 +506,7 @@ func (m *upgradeManager) disableSupervision(ctx context.Context) error {
506506 err := api .ReadKey (ctx , superVisionStateKey , & value )
507507 if err != nil {
508508 m .log .Warningf ("Failed to read supervision state: %v" , err )
509- } else if valueStr , ok := value .( string ); ! ok {
509+ } else if valueStr , ok := getMaintenanceMode ( value ); ! ok {
510510 m .log .Warningf ("Supervision state is not a string but: %v" , value )
511511 } else if valueStr != superVisionStateMaintenance {
512512 m .log .Warningf ("Supervision state is not yet '%s' but '%s'" , superVisionStateMaintenance , valueStr )
@@ -522,6 +522,20 @@ func (m *upgradeManager) disableSupervision(ctx context.Context) error {
522522 }
523523}
524524
525+ func getMaintenanceMode (value interface {}) (string , bool ) {
526+ if s , ok := value .(string ); ok {
527+ return s , true
528+ }
529+ if m , ok := value .(map [string ]interface {}); ok {
530+ if mode , ok := m ["Mode" ]; ok {
531+ return getMaintenanceMode (mode )
532+ } else if mode , ok := m ["mode" ]; ok {
533+ return getMaintenanceMode (mode )
534+ }
535+ }
536+ return "" , false
537+ }
538+
525539// enableSupervision enabled supervision of the agency.
526540func (m * upgradeManager ) enableSupervision (ctx context.Context ) error {
527541 api , err := m .createAgencyAPI ()
0 commit comments