Skip to content

Commit f92f251

Browse files
committed
client secret: fix conditions; secret writing
1 parent 7a8af70 commit f92f251

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pkg/console/controllers/oauthclients/oauthclients.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ func (c *oauthClientsController) sync(ctx context.Context, controllerContext fac
111111
case "", configv1.AuthenticationTypeIntegratedOAuth:
112112
default:
113113
// if we're not using integrated oauth, reset all degraded conditions
114-
statusHandler.AddConditions(status.HandleProgressingOrDegraded("OAuthClientSecretSync", "", nil))
115114
statusHandler.AddConditions(status.HandleProgressingOrDegraded("OAuthClientSync", "", nil))
116115
return statusHandler.FlushAndReturn(nil)
117116
}

pkg/console/controllers/oauthclientsecret/oauthclientsecret.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ func (c *oauthClientSecretController) sync(ctx context.Context, syncCtx factory.
133133
}
134134
default:
135135
klog.V(2).Infof("unknown authentication type: %s", authConfig.Spec.Type)
136-
return nil
136+
statusHandler.AddConditions(status.HandleProgressingOrDegraded("OAuthClientSecretSync", "", nil))
137+
return statusHandler.FlushAndReturn(nil)
137138
}
138139

139140
err = c.syncSecret(ctx, secretString, syncCtx.Recorder())
@@ -148,7 +149,7 @@ func (c *oauthClientSecretController) syncSecret(ctx context.Context, clientSecr
148149
}
149150

150151
secret, err := c.targetNSSecretsLister.Secrets(api.TargetNamespace).Get("console-oauth-config")
151-
if apierrors.IsNotFound(err) || secretsub.GetSecretString(secret) == clientSecret {
152+
if apierrors.IsNotFound(err) || secretsub.GetSecretString(secret) != clientSecret {
152153
_, _, err = resourceapply.ApplySecret(ctx, c.secretsClient, recorder, secretsub.DefaultSecret(operatorConfig, clientSecret))
153154
}
154155
return err

pkg/console/operator/sync_v400.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func (co *consoleOperator) sync_v400(ctx context.Context, controllerContext fact
150150
}
151151

152152
clientSecret, secErr := co.secretsLister.Secrets(api.TargetNamespace).Get(secretsub.Stub().Name)
153-
statusHandler.AddConditions(status.HandleProgressingOrDegraded("OAuthClientSecretSync", "FailedGet", secErr))
153+
statusHandler.AddConditions(status.HandleProgressingOrDegraded("OAuthClientSecretGet", "FailedGet", secErr))
154154
if secErr != nil {
155155
return statusHandler.FlushAndReturn(secErr)
156156
}

0 commit comments

Comments
 (0)