yannh / kubeconform

A FAST Kubernetes manifests validator, with support for Custom Resources!
Apache License 2.0
2.07k stars 116 forks source link

kubeconform does not detect invalid names (eg contain underscore) #235

Closed wiquanAppD closed 9 months ago

wiquanAppD commented 9 months ago

For instance:

apiVersion: v1
data:
  badname_withUnderscore.json: |-
    {
      "info": {
        "name": "DONTCARE"
      }
    }
kind: ConfigMap
metadata:
  name: badname_withUnderscore-t787c9ccbc
  namespace: foobly

Errror Message:

The ConfigMap "badname_withUnderscore-t787c9ccbc" is invalid: metadata.name: Invalid value: "badname_withUnderscore-t787c9ccbc": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
wiquanAppD commented 9 months ago

Dup of 65