instrumenta / instrumenta/kubeval

Validation passes when multiple ServicePorts are specified and unnamed

Open
#316 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
3.2k
Forks
227
PR merge metrics
No merged PRs in 30d

Description

```yaml
apiVersion: v1
kind: Service
metadata:
name: foo-app
spec:
ports:
- port: 80
- port: 443
selector:
app: foo-app
```

```console
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
```

```console
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
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with the provided Service manifest and compare kubeval's strict validation with kubectl's errors. Trace the Service port validation entry point and add coverage showing that multiple unnamed ports are rejected with required-name errors; done when the manifest no longer passes strict validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.