From 9b0e6b6e9e38ed162fc6612604ab15cc4c849834 Mon Sep 17 00:00:00 2001 From: Mariam Fahmy Date: Tue, 12 Sep 2023 14:08:28 +0300 Subject: [PATCH] fix: ignore generating backgroundscan reports for Kyverno policies in case VAPs are generated (#8356) Signed-off-by: Mariam Fahmy --- pkg/controllers/report/utils/utils.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/controllers/report/utils/utils.go b/pkg/controllers/report/utils/utils.go index 5db2e02cdc..45031dd897 100644 --- a/pkg/controllers/report/utils/utils.go +++ b/pkg/controllers/report/utils/utils.go @@ -19,6 +19,9 @@ func CanBackgroundProcess(p kyvernov1.PolicyInterface) bool { if !p.BackgroundProcessingEnabled() { return false } + if p.GetStatus().ValidatingAdmissionPolicy.Generated { + return false + } if err := policyvalidation.ValidateVariables(p, true); err != nil { return false }