From d8bf7fa284751d6c5918f40758cd099e43992425 Mon Sep 17 00:00:00 2001 From: shivkumar dudhani Date: Tue, 12 Nov 2019 16:49:05 -0800 Subject: [PATCH] clean up fixes --- pkg/engine/validation.go | 1 - pkg/policy/report.go | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/engine/validation.go b/pkg/engine/validation.go index 168d89a11e..16c5300be7 100644 --- a/pkg/engine/validation.go +++ b/pkg/engine/validation.go @@ -122,7 +122,6 @@ func validatePatterns(resource unstructured.Unstructured, rule kyverno.Rule) (re if len(errs) > 0 { glog.V(4).Infof("none of anyPattern were processed: %v", errs) response.Success = false - response.Success = false var errorStr []string for index, err := range errs { glog.V(4).Infof("anyPattern[%d] failed at path %s: %v", index, failedPaths[index], err) diff --git a/pkg/policy/report.go b/pkg/policy/report.go index 162e029372..7323f0d0e3 100644 --- a/pkg/policy/report.go +++ b/pkg/policy/report.go @@ -31,7 +31,9 @@ func (pc *PolicyController) cleanUp(ers []engine.EngineResponse) { if !er.IsSuccesful() { continue } - // glog.Info(er.PolicyResponse) + if len(er.PolicyResponse.Rules) == 0 { + continue + } // clean up after the policy has been corrected pc.cleanUpPolicyViolation(er.PolicyResponse) }