kubeval
kubeval copied to clipboard
Does not catch malformed container names
kind: Pod
metadata:
name: demo
labels:
role: myrole
spec:
containers:
- name: bad_name
a DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')]
The name validation rules are unfortunately not part of the Kubernetes OpenAPI schemas on which kubeval relies, this is an upstream bug I think.
Would you (the author of a tool that uses these OpenAPI schemas for validation) help me write a bug report that would get this fixed upstream?
We rely on kubeval
to catch errors that our developers create when writing Helm charts, and it has been invaluable. One of our developers wrote a Helm chart with a mixed-case container name, and it passed kubeval
but broke on deployment in the cluster.
I'd like to help get this fixed, but I'm not familiar with OpenAPI schemas, and I think I'd struggle to write a good enough bug report to convince upstream to get this fixed.