kubeval icon indicating copy to clipboard operation
kubeval copied to clipboard

Add option to error on failed validation

Open B-Souty opened this issue 3 years ago • 4 comments

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.

B-Souty avatar Sep 03 '20 13:09 B-Souty

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.

leosunmo avatar Sep 07 '20 21:09 leosunmo

@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.

B-Souty avatar Sep 29 '20 13:09 B-Souty

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.

yannh avatar Nov 02 '20 09:11 yannh

@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?

leosunmo avatar Nov 02 '20 21:11 leosunmo