instrumenta / kubeval

Validate your Kubernetes configuration files, supports multiple Kubernetes versions
https://kubeval.com
Other
3.16k stars 229 forks source link

Warning that causes Kubeval to exit with non-zero status #260

Open j-zimnowoda opened 3 years ago

j-zimnowoda commented 3 years ago

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
yannh commented 3 years ago

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.

Morriz commented 2 years ago

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