instrumenta / kubeval

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

Validation passes when multiple ServicePorts are specified and unnamed #316

Open watkinsmike opened 3 years ago

watkinsmike commented 3 years ago
apiVersion: v1
kind: Service
metadata:
  name: foo-app
spec:
  ports:
    - port: 80
    - port: 443
  selector:
    app: foo-app
foo@bar:~$ kubectl apply -f service.yaml
The Service "foo-app" is invalid:
* spec.ports[0].name: Required value
* spec.ports[1].name: Required value
foo@bar:~$ kubeval service.yaml --strict

PASS - service.yaml contains a valid Service (foo-app)

```console
foo@bar:~$ kubeval --version
Version: 0.16.1
Commit: f5dba6b486fa18b9179b91e15eb6f2b0f7a5a69e
Date: 2021-03-30T15:17:06Z