1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

skip succeed rules when building the blocked return message (#4804)

Signed-off-by: ShutingZhao <shuting@nirmata.com>

Signed-off-by: ShutingZhao <shuting@nirmata.com>
This commit is contained in:
shuting 2022-10-04 18:34:37 +08:00 committed by GitHub
parent 4e1c1e6785
commit e75b57e635
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,7 +51,9 @@ func GetBlockedMessages(engineResponses []*response.EngineResponse) string {
}
}
}
failures[er.PolicyResponse.Policy.Name] = ruleToReason
if len(ruleToReason) != 0 {
failures[er.PolicyResponse.Policy.Name] = ruleToReason
}
}
if len(failures) == 0 {
return ""