yannh / kubeconform

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

Kubeconform does not report when "metadata.name" is missing #286

Open yogeek opened 2 months ago

yogeek commented 2 months ago
cat <<EOF | kubeconform -
apiVersion: v1
kind: Pod
metadata:
  names: myapp  # <====== "names" instead of "name"
  labels:
    name: myapp
spec:
  containers:
  - name: myapp
    image: <Image>
EOF
# !!! no error !!!

Even if I remove the "name" field entirely, no error in kubeconform...

cat <<EOF | kubeconform -
apiVersion: v1
kind: Pod
metadata:
  # no name field !!!
  labels:
    name: myapp
spec:
  containers:
  - name: myapp
    image: <Image>
EOF
# !!! no error !!!

Tested with kubeconform 0.6.6 and 0.6.7 (installed with devbox)