Skip to content

Commit

Permalink
fix authconfig annotations reconciliation
Browse files Browse the repository at this point in the history
  • Loading branch information
eguzki committed Dec 5, 2023
1 parent f17aadb commit 62ff20d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions controllers/authpolicy_authconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (r *AuthPolicyReconciler) reconcileAuthConfigs(ctx context.Context, ap *api
return err
}

err = r.ReconcileResource(ctx, &authorinoapi.AuthConfig{}, authConfig, alwaysUpdateAuthConfig)
err = r.ReconcileResource(ctx, &authorinoapi.AuthConfig{}, authConfig, authConfigBasicMutator)
if err != nil && !apierrors.IsAlreadyExists(err) {
logger.Error(err, "ReconcileResource failed to create/update AuthConfig resource")
return err
Expand Down Expand Up @@ -496,7 +496,7 @@ func toAuthorinoOneOfPatternExpressionsOrRefs(oneOf []authorinoapi.PatternExpres
}
}

func alwaysUpdateAuthConfig(existingObj, desiredObj client.Object) (bool, error) {
func authConfigBasicMutator(existingObj, desiredObj client.Object) (bool, error) {
existing, ok := existingObj.(*authorinoapi.AuthConfig)
if !ok {
return false, fmt.Errorf("%T is not an *authorinoapi.AuthConfig", existingObj)
Expand All @@ -506,11 +506,11 @@ func alwaysUpdateAuthConfig(existingObj, desiredObj client.Object) (bool, error)
return false, fmt.Errorf("%T is not an *authorinoapi.AuthConfig", desiredObj)
}

if reflect.DeepEqual(existing.Spec, desired.Spec) && reflect.DeepEqual(existing.Annotations, desired.Annotations) {
if reflect.DeepEqual(existing.Spec, desired.Spec) {
return false, nil
}

existing.Spec = desired.Spec
existing.Annotations = desired.Annotations

return true, nil
}

0 comments on commit 62ff20d

Please sign in to comment.