@@ -136,20 +136,27 @@ func (c *oidcSetupController) sync(ctx context.Context, syncCtx factory.SyncCont
136
136
return err
137
137
}
138
138
139
+ if authnConfig .Spec .Type != configv1 .AuthenticationTypeOIDC {
140
+ applyErr := c .authStatusHandler .Apply (ctx , authnConfig )
141
+ statusHandler .AddConditions (status .HandleProgressingOrDegraded ("AuthStatusHandler" , "FailedApply" , applyErr ))
142
+
143
+ // reset the other condition set by this controller
144
+ statusHandler .AddConditions (status .HandleProgressingOrDegraded ("OIDCClientConfig" , "" , nil ))
145
+ return statusHandler .FlushAndReturn (applyErr )
146
+ }
147
+
139
148
// we need to keep track of errors during the sync so that we can requeue
140
149
// if any occur
141
150
var errs []error
142
- if authnConfig .Spec .Type == configv1 .AuthenticationTypeOIDC {
143
- syncErr := c .syncAuthTypeOIDC (ctx , syncCtx , statusHandler , operatorConfig , authnConfig )
144
- statusHandler .AddConditions (
145
- status .HandleProgressingOrDegraded (
146
- "OIDCClientConfig" , "OIDCConfigSyncFailed" ,
147
- syncErr ,
148
- ),
149
- )
150
- if syncErr != nil {
151
- errs = append (errs , syncErr )
152
- }
151
+ syncErr := c .syncAuthTypeOIDC (ctx , syncCtx , statusHandler , operatorConfig , authnConfig )
152
+ statusHandler .AddConditions (
153
+ status .HandleProgressingOrDegraded (
154
+ "OIDCClientConfig" , "OIDCConfigSyncFailed" ,
155
+ syncErr ,
156
+ ),
157
+ )
158
+ if syncErr != nil {
159
+ errs = append (errs , syncErr )
153
160
}
154
161
155
162
applyErr := c .authStatusHandler .Apply (ctx , authnConfig )
0 commit comments