diff --git a/pkg/controllers/report/utils/scanner.go b/pkg/controllers/report/utils/scanner.go index 3ff83059ca..6a7bb233b8 100644 --- a/pkg/controllers/report/utils/scanner.go +++ b/pkg/controllers/report/utils/scanner.go @@ -85,6 +85,12 @@ func (s *scanner) validateResource(ctx context.Context, resource unstructured.Un } func (s *scanner) validateImages(ctx context.Context, resource unstructured.Unstructured, nsLabels map[string]string, policy kyvernov1.PolicyInterface) (*engineapi.EngineResponse, error) { + annotations := resource.GetAnnotations() + if annotations != nil { + resource = *resource.DeepCopy() + delete(annotations, "kyverno.io/verify-images") + resource.SetAnnotations(annotations) + } policyCtx, err := engine.NewPolicyContext(s.jp, resource, kyvernov1.Create, nil, s.config) if err != nil { return nil, err