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

changed the log level in match policy context (#9626)

Signed-off-by: Vaibhav Mewada <vaibhav@zoop.one>
Co-authored-by: Vaibhav Mewada <vaibhav@zoop.one>
Co-authored-by: shuting <shuting@nirmata.com>
This commit is contained in:
Vaibhav Mewada 2024-02-23 16:43:55 +05:30 committed by GitHub
parent 2b2587469d
commit ea48bdeb31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,18 +21,18 @@ func MatchPolicyContext(logger logr.Logger, client engineapi.Client, policyConte
old := policyContext.OldResource()
new := policyContext.NewResource()
if !checkNamespacedPolicy(policy, new, old) {
logger.V(2).Info("policy namespace doesn't match resource namespace")
logger.V(4).Info("policy namespace doesn't match resource namespace")
return false
}
gvk, subresource := policyContext.ResourceKind()
if !checkResourceFilters(configuration, gvk, subresource, new, old) {
logger.V(2).Info("configuration resource filters doesn't match resource")
logger.V(4).Info("configuration resource filters doesn't match resource")
return false
}
if policy.GetSpec().GetMatchConditions() != nil {
if !checkMatchConditions(logger, client, policyContext, gvk, subresource) {
logger.V(2).Info("webhookConfiguration.matchConditions doesn't match request")
logger.V(4).Info("webhookConfiguration.matchConditions doesn't match request")
return false
}
}