fix: don't add intial OpenShift OAuth user if native user mode is on (#1066)

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
pull/1068/head
Anatolii Bazko 2021-09-14 16:54:35 +03:00 committed by GitHub
parent 8b1dd1527a
commit 753eafe88c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -685,6 +685,10 @@ func (r *CheClusterReconciler) autoEnableOAuth(deployContext *deploy.DeployConte
} else {
if len(openshitOAuth.Spec.IdentityProviders) > 0 {
oauth = true
} else if util.IsNativeUserModeEnabled(deployContext.CheCluster) {
// enable OpenShift OAuth without adding initial OpenShift OAuth user
// since kubeadmin is a valid user for native user mode
oauth = true
} else if util.IsInitialOpenShiftOAuthUserEnabled(cr) {
provisioned, err := r.userHandler.SyncOAuthInitialUser(openshitOAuth, deployContext)
if err != nil {