File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ func (r *AuthenticationReconciler) createV1CertificateIfNotPresent(authCR *opera
252
252
}
253
253
}
254
254
255
- // addLabelIfMissing adds "manage-cert-rotation": "yes " label to the certificate if not exist
255
+ // addLabelIfMissing adds "manage-cert-rotation": "true " label to the certificate if not exist
256
256
func (r * AuthenticationReconciler ) addLabelIfMissing (fieldsList []* reconcileCertificateFields ) (fn subreconciler.Fn ) {
257
257
return func (ctx context.Context ) (result * ctrl.Result , err error ) {
258
258
reqLogger := ctrl .LoggerFrom (ctx )
@@ -289,9 +289,10 @@ func (r *AuthenticationReconciler) updateCertWithLabel(fields *reconcileCertific
289
289
err = r .Get (ctx , fields .NamespacedName , cert )
290
290
if err == nil {
291
291
certRotationKey := "manage-cert-rotation"
292
- if _ , exists := cert .Labels [certRotationKey ]; ! exists {
293
- reqLogger .Info ("Updating Certificate with label" )
294
- cert .Labels [certRotationKey ] = "yes"
292
+ labelValue , exists := cert .Labels [certRotationKey ]
293
+ if ! exists || labelValue == "yes" {
294
+ reqLogger .Info ("Updating Certificate with label manage-cert-rotation: true" )
295
+ cert .Labels [certRotationKey ] = "true"
295
296
err = r .Update (ctx , cert )
296
297
if err != nil {
297
298
reqLogger .Error (err , "Failed to update Certificate with label" )
You can’t perform that action at this time.
0 commit comments