-
Notifications
You must be signed in to change notification settings - Fork 769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
excludedNamespaces wildcard with more than one dashes #3034
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
The Is k8s random name generation involved (e.g. how pod names are generated)? Relevant code: gatekeeper/pkg/wildcard/wildcard.go Lines 17 to 41 in c0e231a
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
Somehow I did not see the notification. The "-test-" example did not work, this was why I created the issue. Since it is just trimming I guess it matches "-test-" then which is not the desired behavior. |
It should be a "contains" match, so any namespace with "-test-" as a substring should match. Can you verify this behavior is still broken with a newer release and give the Gatekeeper version? If it is still broken, can you give an example constraint, template, and resource that should be exempt but is throwing a violation? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
While trying to create a Constraint we saw that "excludedNamespaces" does not appear to exclude namespaces with more than one dash and wildcards combined, e.g.
What did you expect to happen:
We expect to have namespaces like user1-test-randomstring being excluded which does not work.
Namespaces, e.g. user1-randomstring, with "excludedNamespaces" with "randomstring-*" are getting excluded.
Environment:
kubectl version
):Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.2", GitCommit:"31aa3e89a926f81aa0af30320ffcb71acadf3015", GitTreeState:"clean", BuildDate:"2023-04-07T07:26:22Z", GoVersion:"go1.19.6", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.11+1485cc9", GitCommit:"0c8cb213485c84deb0230cbefa34bf7f1c311418", GitTreeState:"clean", BuildDate:"2023-07-04T08:59:21Z", GoVersion:"go1.19.10 X:strictfipsruntime", Compiler:"gc", Platform:"linux/amd64"}
The text was updated successfully, but these errors were encountered: