instrumenta / kubeval

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

--ignore-missing-schemas ignores all schemas #149

Closed ian-howell closed 5 years ago

ian-howell commented 5 years ago

The expected behavior of the --ignore-missing-schemas flag should be to validate (or at least report that no action was taken) any resources whose schemas could not be found. The actual behavior is to simply ignore all schemas and report that each document is valid. This means that the only validation that kubeval actually performs is a check for a valid YAML document and valid kind and apiVersion attributes.

The following demonstrates this:

# Without the flag
$ kubeval fixtures/invalid.yaml
The document fixtures/invalid.yaml contains an invalid ReplicationController
---> spec.replicas: Invalid type. Expected: integer, given: string

# With the flag
$ kubeval fixtures/invalid.yaml --ignore-missing-schemas
Warning: Set to ignore missing schemas
The document fixtures/invalid.yaml contains a valid ReplicationController
garethr commented 5 years ago

Thanks for reporting and fixing in #150.