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

fix: global anchor warning (#4962)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2022-10-17 13:45:57 +02:00 committed by GitHub
parent a89fbac333
commit 6270d40f50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View file

@ -10,7 +10,7 @@ func GetWarningMessages(engineResponses []*response.EngineResponse) []string {
var warnings []string
for _, er := range engineResponses {
for _, rule := range er.PolicyResponse.Rules {
if rule.Status != response.RuleStatusPass {
if rule.Status != response.RuleStatusPass && rule.Status != response.RuleStatusSkip {
msg := fmt.Sprintf("policy %s.%s: %s", er.Policy.GetName(), rule.Name, rule.Message)
warnings = append(warnings, msg)
}

View file

@ -92,7 +92,6 @@ func TestGetWarningMessages(t *testing.T) {
"policy test.rule-warn: message warn",
"policy test.rule-fail: message fail",
"policy test.rule-error: message error",
"policy test.rule-skip: message skip",
},
}}
for _, tt := range tests {