instrumenta / kubeval

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

Allow for ignoring certain filenames #191

Closed bmcustodio closed 4 years ago

bmcustodio commented 4 years ago

It would be great if kubeval could take something like a --ignore-filenames=X,Y,Z flag using which one could specify filenames to be ignored. The end goal would be to run kubeval against a repository similar to https://github.com/weaveworks/flux-kustomize-example and having it ignore the .flux.yaml file (which is not supposed to be a valid manifest, but must exist alongside manifests).

jp83 commented 4 years ago

Agree, I just set this up as a github action for my gitops repo, it finds that yaml and flags error ERR - .github/workflows/validate.yaml: Missing 'kind' key. I could move all my k8s yaml into it's own dir or list all of the dirs (ex. organized by namespace), but that would require an unnecessary organizational level and could still encounter exceptions like above.

garethr commented 4 years ago

https://github.com/instrumenta/kubeval/pull/192 introduces a new flag to ignore files by pattern. This will be in the next release.