1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

construct policy Info

This commit is contained in:
shivkumar dudhani 2019-08-13 17:24:05 -07:00
parent b0d7cdba6f
commit d8c6dc3bc6
2 changed files with 2 additions and 2 deletions

View file

@ -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("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()) // 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 //MUTATION
mruleInfos, err := mutation(policy, resource) mruleInfos, err := mutation(policy, resource)
policyInfo.AddRuleInfos(mruleInfos) policyInfo.AddRuleInfos(mruleInfos)

View file

@ -11,7 +11,6 @@ import (
func (pc *PolicyController) report(policyInfos []info.PolicyInfo) { func (pc *PolicyController) report(policyInfos []info.PolicyInfo) {
// generate events // generate events
// generate policy violations // generate policy violations
for _, policyInfo := range policyInfos { for _, policyInfo := range policyInfos {
// events // events
// success - policy applied on resource // success - policy applied on resource