Add option to error on failed validation#254
Add option to error on failed validation#254B-Souty wants to merge 1 commit intoinstrumenta:masterfrom
Conversation
|
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. |
|
@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. |
|
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 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? |
carlossg
left a comment
There was a problem hiding this comment.
I would change strictValidation to errorOnValidation to avoid confusion
Can you add a test?
This adds an option
--error-on-validation-failureto 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.