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

Merge pull request #1316 from NoSkillGirl/improve_cli_message

added log level for skipped policy
This commit is contained in:
Jim Bugwadia 2020-11-25 23:22:39 -08:00 committed by GitHub
commit d61e5bf318
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -213,7 +213,7 @@ To apply policy with variables:
err := policy2.Validate(utils.MarshalPolicy(*policy), nil, true, openAPIController)
if err != nil {
rc.skip += len(resources)
fmt.Printf("\nskipping policy %v as it is not valid: %v\n", policy.Name, err)
log.Log.V(3).Info(fmt.Sprintf("skipping policy %v as it is not valid", policy.Name), "error", err)
continue
}
@ -221,6 +221,7 @@ To apply policy with variables:
variable := removeDuplicatevariables(matches)
if len(matches) > 0 && variablesString == "" && valuesFile == "" {
rc.skip++
skipPolicy := SkippedPolicy{
Name: policy.GetName(),
Rules: policy.Spec.Rules,