Skip to content

Commit 212fbfd

Browse files
committed
fix(oidc): fix secret lookup and add condition cleanup
This commit addresses two issues related to OIDC authentication: 1. Fixed OIDC client secret lookup in oidcsetup controller to use the correct namespace (openshift-config) and dynamic secret name from the Authentication CR, instead of hardcoded values. 2. Added condition cleanup in sync_v400 to properly clear the OIDCProviderTrustedAuthorityConfigGet degraded condition when authentication type changes from OIDC to non-OIDC (e.g., IntegratedOAuth). This prevents the Console Operator from remaining in a Degraded state indefinitely during rollback scenarios. The second fix follows the same pattern used in the oidcsetup controller for clearing conditions when auth type is not OIDC. Assisted-by: Claude Code 2.0.5, claude-sonnet-4-5@20250929 Signed-off-by: Ahmed Abdalla <[email protected]>
1 parent ca22e61 commit 212fbfd

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pkg/console/controllers/oidcsetup/oidcsetup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func (c *oidcSetupController) syncAuthTypeOIDC(ctx context.Context, authnConfig
200200
return nil
201201
}
202202

203-
clientSecret, err := c.targetNSSecretsLister.Secrets(api.TargetNamespace).Get("console-oauth-config")
203+
clientSecret, err := c.targetNSSecretsLister.Secrets(api.OpenShiftConfigNamespace).Get(clientConfig.ClientSecret.Name)
204204
if err != nil {
205205
c.authStatusHandler.Degraded("OIDCClientSecretGet", err.Error())
206206
return err

pkg/console/operator/sync_v400.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ func (co *consoleOperator) sync_v400(ctx context.Context, controllerContext fact
117117
if err != nil {
118118
return statusHandler.FlushAndReturn(err)
119119
}
120+
default:
121+
// Clear OIDC-related conditions when auth type is not OIDC
122+
statusHandler.AddConditions(status.HandleProgressingOrDegraded("OIDCProviderTrustedAuthorityConfigGet", "", nil))
120123
}
121124

122125
customLogosErr, customLogosErrReason := co.SyncCustomLogos(updatedOperatorConfig)

0 commit comments

Comments
 (0)