Skip to content

Add option to error on failed validation#254

Open
B-Souty wants to merge 1 commit into
instrumenta:masterfrom
B-Souty:error-on-validation
Open

Add option to error on failed validation#254
B-Souty wants to merge 1 commit into
instrumenta:masterfrom
B-Souty:error-on-validation

Conversation

@B-Souty

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

Copy link
Copy Markdown

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

leosunmo commented Sep 7, 2020

Copy link
Copy Markdown

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

B-Souty commented Sep 29, 2020

Copy link
Copy Markdown
Author

@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

yannh commented Nov 2, 2020

Copy link
Copy Markdown

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

leosunmo commented Nov 2, 2020

Copy link
Copy Markdown

@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 carlossg left a comment

Copy link
Copy Markdown
Collaborator

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