kubeval
kubeval copied to clipboard
Should not PASS on empty input
Considering that kubeval is probably run mostly in CI pipelines, I think it is funny that kubeval exits with 0 when it gets an empty input.
Do you guys consider that it is more likely that you would intentionally pass empty input to kubeval, OR could that possibly be a sign of a previous error that there is no input to validate?
I know you can't change this outright for BC, but a flag for "--fail-if-empty" would be a welcome addition for CI environments.
IMO this should be opt-in. Helm can create empty files if the template does not write any content, such as the case of a conditional file, and this should not cause kubeval to fail.
I would be interested with what you define as "empty input" - a folder with at least a single file that is empty? Should a file with an empty resource, eg
`
Kind: Deployment [A valid resource here]
` Notice the two yaml separators ^ - seems like this is breaking the Markdown rendering sorry.
Or do you mean - when kubeval reads from stdin, and stdin is empty? could you clarify? Thanks!
I agree, if passed empty yaml there should be an option to fail. This would be incredibly useful as Kustomize, on error, produces empty manifests.