Skip to content

Commit

Permalink
changed the log level in match policy context (kyverno#9626)
Browse files Browse the repository at this point in the history
Signed-off-by: Vaibhav Mewada <[email protected]>
Co-authored-by: Vaibhav Mewada <[email protected]>
Co-authored-by: shuting <[email protected]>
  • Loading branch information
3 people authored Feb 23, 2024
1 parent 2b25874 commit ea48bde
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/engine/internal/match.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit ea48bde

Please sign in to comment.