Skip to content

Commit

Permalink
Explicitly check to see if AD is disabled, and exit success in this case
Browse files Browse the repository at this point in the history
  • Loading branch information
nflynt committed Aug 15, 2023
1 parent 4a3aa80 commit 2dd5250
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/agent/clean/adunmigration/migrate.go
Expand Up @@ -166,6 +166,13 @@ func UnmigrateAdGUIDUsers(clientConfig *restclient.Config, dryRun bool, deleteMi
logrus.Errorf("[%v] unable to update migration status configmap: %v", migrateAdUserOperation, err)
}
}(sc, activedirectory.StatusMigrationField)

// Early bail: if the AD configuration is disabled, then we're done! Update the configmap right now and exit.
if !adConfig.Enabled {
logrus.Infof("[%v] during unmigration, found that Active Directory is not enabled. nothing to do", migrateAdUserOperation)
finalStatus = activedirectory.StatusMigrationFinished
return nil
}
}

users, err := sc.Management.Users("").List(metav1.ListOptions{})
Expand Down

0 comments on commit 2dd5250

Please sign in to comment.