[Bug] namespaceSelector not working 1.14.1 #13093
Labels
bug
Something isn't working
good first issue
Good for newcomers
validation
Issues pertaining to the validate ability.
Milestone
Kyverno Version
1.14.1
Description
Hi,
In summary I found an issue in kyverno 1.14.1 which affects the usage of spec.EmitWarning and namespaceSelectors
it does not matter if you use matchLabels or matchExpressions.
Bug found
New installation of Kyverno 1.14.1, applying the same policies than 1.13.3 and I discovered that when you use the namespaceSelector under a rule in Audit mode the spec.emitWarning is not working.
Environment used
Openshift --- > Server Version: 4.16.36
Kubernetes Version --- > v1.29.11+148a389
oc client --- > 4.16.0-202502111405.p0.gcf533b5.assembly.stream.el9-cf533b5
What I want to achieve
To use the option of spec.emitWarning in order to warn the users that something is not compliance before activate the policy in Enforce mode. Looks like the ability to use a namespaceSelector with specific labels in order to apply a policy to namespaces that contains specific labels is not working anymore and is not showing a Warning message once we create an object which is not compliance with this rule.
Example of Policy
Example of object
Example of Namespace
Other information.
I have confirmed via Slack with a user that this could be an issue of the newer version of Kyverno, as it was working under 1.13.3 and not in 1.14.1
Slack discussion
https://kubernetes.slack.com/archives/CLGR9BJU9/p1746712157755789
Troubleshooting
The text was updated successfully, but these errors were encountered: