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

KubeConform does not give error on invalid namespace names #82

Closed
Moulick opened this issue Nov 14, 2021 · 2 comments
Closed

KubeConform does not give error on invalid namespace names #82

Moulick opened this issue Nov 14, 2021 · 2 comments

Comments

@Moulick
Copy link

Moulick commented Nov 14, 2021

Kubeconform does not give an error when fed a invalid namespace as below

apiVersion: v1
kind: Namespace
metadata:
  name: .hello
❯ kubeconform -verbose -strict namespace.yaml
namespace.yaml - Namespace .hello is valid

Version: 0.4.12

This is same as in KubeVal instrumenta/kubeval#321

@eyarz
Copy link
Contributor

eyarz commented Nov 15, 2021

This validation (verifying the name value is valid) is not part K8s JSON Schema that Kubeconform is using to validate your manifest. This is why it will also happen if you will run kubectl --dry-run=client. Therefore, it's not a bug, just a limitation.

@yannh
Copy link
Owner

yannh commented Nov 15, 2021

Thanks @eyarz , and indeed - there are quite a few scenarios where Kubeconform will not detect an error, but the resource might still fail to apply. The correct (alas not so easy) way to fix this is to improve Kubernetes' swagger file,which is pretty much what Kubeconform validates against. Sorry :(

@yannh yannh closed this as completed Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants