kubeval icon indicating copy to clipboard operation
kubeval copied to clipboard

Warning that causes Kubeval to exit with non-zero status

Open j-zimnowoda opened this issue 3 years ago • 2 comments

Hi,

I am having a warning that causes Kubeval to exit with non-zero status .

WARN - ***.yaml contains an invalid ClusterIssuer (letsencrypt-staging) - spec.acme.solvers.0.dns01: Invalid type. Expected: object, given: null

After fixing it everything works fine - other warnings do not cause the kubeval failure.

In my opinion this is issue shouldn't be reported as WARN but as ERR.

Here is how I am running it:

kubeval --skip-kinds CustomResourceDefinition --ignored-filename-patterns "crd,knative-services" --force-color -d /tmp/k8s --schema-location /tmp/schema --kubernetes-version  "1.16.0"

and versions:

kubeval --version
Version: 0.15.0
Commit: df50ea7fd4fd202458002a40a6a39ffbb3125bad
Date: 2020-04-14T09:32:29Z

j-zimnowoda avatar Oct 29 '20 13:10 j-zimnowoda

I agree that the behaviour between warnings is inconsistent, some cause an exit code of 0 some not. I agree with you - I think most warnings should just be reported as errors and cause a return code >0.

yannh avatar Dec 14 '20 17:12 yannh

bumping this as it would be nice to get a report as to which caused the exitcode != 0

Morriz avatar Feb 28 '22 19:02 Morriz