diff --git a/pkg/controller/constrainttemplate/constrainttemplate_controller.go b/pkg/controller/constrainttemplate/constrainttemplate_controller.go index d6dcae45af8..b6716938d08 100644 --- a/pkg/controller/constrainttemplate/constrainttemplate_controller.go +++ b/pkg/controller/constrainttemplate/constrainttemplate_controller.go @@ -21,7 +21,6 @@ import ( "flag" "fmt" "reflect" - // "strconv". "time" @@ -770,7 +769,9 @@ func (r *ReconcileConstraintTemplate) generateCRD(ctx context.Context, ct *v1bet err := r.reportErrorOnCTStatus(ctx, ErrUpdateCode, "Could not update CRD", status, err) return err } - ct.Annotations[constraint.BlockVAPBGenerationUntilAnnotation] = "" + if ct.Annotations != nil { + ct.Annotations[constraint.BlockVAPBGenerationUntilAnnotation] = "" + } } if !generateVAP { return nil