Skip to content
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

[BUG] Policy violation is reported incorrectly for policy "disallow-default-namespace" #734

Closed
realshuting opened this issue Mar 5, 2020 · 0 comments · Fixed by #735
Closed
Assignees
Labels
bug Something isn't working

Comments

@realshuting
Copy link
Member

Describe the bug
With best practice policy disallow-default-namespace, kyverno will add the autogen rule on pod controllers, there would be a problem for this. According to the error message, such as Deployment, in its .spec.template.metadata, there’s no namespace field specified - namespace would only be specified in .metadata . And Kyverno takes it as default namespace and then generate PolicyViolation for the resource.

'Validation error: Using ''default'' namespace is not allowed; Validation rule ''autogen-validate-namespace'' failed at path ''/spec/template/metadata/namespace/'''

We should disable the autogen feature on this policy, but update the policy with the additional rules which applies to pod controllers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant