kubeval icon indicating copy to clipboard operation
kubeval copied to clipboard

Does not catch malformed container names

Open drts01 opened this issue 6 years ago • 2 comments

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])?')]

drts01 avatar May 07 '18 00:05 drts01

The name validation rules are unfortunately not part of the Kubernetes OpenAPI schemas on which kubeval relies, this is an upstream bug I think.

garethr avatar Aug 17 '18 10:08 garethr

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.

irasnyd avatar Jun 19 '20 00:06 irasnyd