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

Add option to error on failed validation #254

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

B-Souty
Copy link

@B-Souty B-Souty commented Sep 3, 2020

This adds an option --error-on-validation-failure to generate an error instead of a simple warning if a resource fails to validate when outputting to STDOUT.

This makes it easier to detect misconfigured manifests when running kubeval against a lot of resources.

@leosunmo
Copy link

leosunmo commented Sep 7, 2020

One could also argue that this setting should be permanent, and not a flag. But if it breaks people's existing CI pipeline a flag might be better.

@B-Souty
Copy link
Author

B-Souty commented Sep 29, 2020

@garethr could you please have a look at this PR, this would be really useful to fail a CI pipeline with an error if a resource is misconfigured rather than just warn about it.

@yannh
Copy link

yannh commented Nov 2, 2020

It seems like you called this option "strictValidation", this gets very confusing since there is also -strict which is different? I also believe that this should be the default.

@leosunmo
Copy link

leosunmo commented Nov 2, 2020

@yannh Yeah you might be right regarding the confusion of 'strict' flags. It's a non-issue if this becomes the default behaviour though!

Would the maintainers be open to making this default and potentially breaking (not sure it would be that bad, I feel like it should have been failing all along) people's CI pipelines?

Copy link
Collaborator

@carlossg carlossg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change strictValidation to errorOnValidation to avoid confusion
Can you add a test?

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

Successfully merging this pull request may close these issues.

4 participants