From d8c6dc3bc640110c81f65c4fd3ee765f10f890a4 Mon Sep 17 00:00:00 2001 From: shivkumar dudhani Date: Tue, 13 Aug 2019 17:24:05 -0700 Subject: [PATCH] construct policy Info --- pkg/policy/apply.go | 3 ++- pkg/policy/report.go | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/policy/apply.go b/pkg/policy/apply.go index c07358d46c..019fb931e6 100644 --- a/pkg/policy/apply.go +++ b/pkg/policy/apply.go @@ -21,7 +21,8 @@ func applyPolicy(policy kyverno.Policy, resource unstructured.Unstructured) (inf glog.V(4).Infof("Finished applying %s on resource %s/%s/%s (%v)", policy.Name, resource.GetKind(), resource.GetNamespace(), resource.GetName(), time.Since(startTime)) }() // glog.V(4).Infof("apply policy %s with resource version %s on resource %s/%s/%s with resource version %s", policy.Name, policy.ResourceVersion, resource.GetKind(), resource.GetNamespace(), resource.GetName(), resource.GetResourceVersion()) - var policyInfo info.PolicyInfo + policyInfo := info.NewPolicyInfo(policy.Name, resource.GetKind(), resource.GetName(), resource.GetNamespace(), policy.Spec.ValidationFailureAction) + //MUTATION mruleInfos, err := mutation(policy, resource) policyInfo.AddRuleInfos(mruleInfos) diff --git a/pkg/policy/report.go b/pkg/policy/report.go index c232494cbc..f3b80097a9 100644 --- a/pkg/policy/report.go +++ b/pkg/policy/report.go @@ -11,7 +11,6 @@ import ( func (pc *PolicyController) report(policyInfos []info.PolicyInfo) { // generate events // generate policy violations - for _, policyInfo := range policyInfos { // events // success - policy applied on resource