Skip to content

Commit 8486513

Browse files
stlazdeads2k
authored andcommitted
authn status handling: flush conditions on Apply()
1 parent 95766a7 commit 8486513

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/console/status/auth_status.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ type AuthStatusHandler struct {
2727
currentClientID string
2828
}
2929

30+
// NewAuthStatusHandler creates a handler for updating the Authentication.config.openshift.io
31+
// status with information about the expected and currently used OIDC client.
32+
// Not thread safe, only use in controllers with a single worker!
3033
func NewAuthStatusHandler(authnClient configv1client.AuthenticationInterface, componentName, componentNamespace, fieldManager string) AuthStatusHandler {
3134
return AuthStatusHandler{
3235
client: authnClient,
@@ -83,6 +86,10 @@ func (c *AuthStatusHandler) WithCurrentOIDCClient(currentClientID string) {
8386
}
8487

8588
func (c *AuthStatusHandler) Apply(ctx context.Context, authnConfig *configv1.Authentication) error {
89+
defer func() {
90+
c.conditionsToApply = map[string]*metav1.Condition{}
91+
}()
92+
8693
applyConfig, err := configv1ac.ExtractAuthenticationStatus(authnConfig, c.fieldManager)
8794
if err != nil {
8895
return err

0 commit comments

Comments
 (0)