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

Schema validation silently fails for non-existent Kubernetes version #32

Closed
Niksko opened this issue Jan 20, 2021 · 2 comments
Closed

Comments

@Niksko
Copy link

Niksko commented Jan 20, 2021

Tried to do validation against K8s 1.19, which as per my other issue, isn't in the default schema repo. Instead of throwing an error, this seemed to just silently fail and skip validation of all resources.

Steps to reproduce:

$ kubeconform -ignore-missing-schemas -kubernetes-version 1.19.0 -summary
Summary: 964 resources found in 450 files - Valid: 0, Invalid: 0, Errors: 0, Skipped: 964

Expected result:
Some sort of error because the 1.19 schemas don't exist.

Presumably this is because I'm passing -ignore-missing-schemas? However if I don't pass -ignore-missing-schemas, I just get Summary: 964 resources found in 450 files - Valid: 0, Invalid: 0, Errors: 964, Skipped: 0.

@yannh
Copy link
Owner

yannh commented Jan 21, 2021

Hi @Niksko , this seems to work as expected? If you ignore missing schemas, it will skip resources for which it doesnt find a shema - in this case all of them. If you do not pass -ignore-missing-schemas, it will error when it doesnt find a schema for a resource - in this case for all of them...

I would recommend you use -skip to explicitly ignore the kinds for which you know you do not have a schema, so that you don't get these silent errors as when using -ignore-missing-schemas.

@yannh
Copy link
Owner

yannh commented Feb 14, 2021

I will close this since it is working as expected - a Kubernetes version missing should trigger a "schema not found" - I can't get kubeconform to fail on it, since you might be specifying multiple schema locations... I hope you found a way to get this to work with -skip :)

@yannh yannh closed this as completed Feb 14, 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

2 participants