diff --git a/pkg/controller/constrainttemplate/constrainttemplate_controller.go b/pkg/controller/constrainttemplate/constrainttemplate_controller.go index cfc728eacac..a9dbb7cccea 100644 --- a/pkg/controller/constrainttemplate/constrainttemplate_controller.go +++ b/pkg/controller/constrainttemplate/constrainttemplate_controller.go @@ -379,7 +379,7 @@ func (r *ReconcileConstraintTemplate) Reconcile(ctx context.Context, request rec return reconcile.Result{}, err } generateVap, err := constraint.ShouldGenerateVAP(unversionedCT) - if err != nil || !errors.Is(err, celSchema.ErrCodeNotDefined) { + if err != nil && !errors.Is(err, celSchema.ErrCodeNotDefined) { logger.Error(err, "generateVap error") } logger.Info("generateVap", "r.generateVap", generateVap)