mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-15 17:51:20 +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:
parent
2b2587469d
commit
ea48bdeb31
1 changed files with 3 additions and 3 deletions
|
@ -21,18 +21,18 @@ func MatchPolicyContext(logger logr.Logger, client engineapi.Client, policyConte
|
||||||
old := policyContext.OldResource()
|
old := policyContext.OldResource()
|
||||||
new := policyContext.NewResource()
|
new := policyContext.NewResource()
|
||||||
if !checkNamespacedPolicy(policy, new, old) {
|
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
|
return false
|
||||||
}
|
}
|
||||||
gvk, subresource := policyContext.ResourceKind()
|
gvk, subresource := policyContext.ResourceKind()
|
||||||
if !checkResourceFilters(configuration, gvk, subresource, new, old) {
|
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
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if policy.GetSpec().GetMatchConditions() != nil {
|
if policy.GetSpec().GetMatchConditions() != nil {
|
||||||
if !checkMatchConditions(logger, client, policyContext, gvk, subresource) {
|
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
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue