instrumenta / kubeval

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

Validation of Kustomization files #328

Closed alisonjenkins closed 9 months ago

alisonjenkins commented 2 years ago

Over Christmas I hit an issue where I had gotten confused and tried to put a Flux CRD Kustomization in a file called kustomization.yaml.

This was giving me unusual errors (I filed an issue against FluxCD here: https://github.com/fluxcd/flux2/issues/2251).

The problem is that the file name kustomization.yaml is reserved for Kustomize's variant of Kustomization and if you make the mistake of putting anything else in a file of that name you will get unhelpful errors.

Would it be possible to have kubeval validate kustomization.yaml files and if the contents of a file by that name does not fit a Kustomize Kustomization schema and mentions a apiVersion and kind that it warns that the file name kustomization.yaml is reserved for Kustomize and that you should name your file (or something to that effect)?

muhammedsaidkaya commented 2 years ago

Also this one ... Kustomizations Validation