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:
commit
d61e5bf318
1 changed files with 2 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue