instrumenta / instrumenta/kubeval

[question] Environment variables are not checked

Open
#193 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

First of all - thanks for the great project.

I've tried using it in my pipelines, and things work so far. But I've noticed that incorrect environment variables are not detected, while `helm upgrade` fails with proper error message. For example, if I have `999Test` env variable defined, I'd get:
```spec.template.spec.containers[0].env[4].name: Invalid value: "999Test": a valid environment variable name must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit (e.g. 'my.env-name', or 'MY_ENV.NAME', or 'MyEnvName1', regex used for validation is '[-._a-zA-Z][-._a-zA-Z0-9]*')```

According to the [spec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#envvar-v1-core), `name` is just a string, so I'm not sure such checks are even possible with `kubeval`, thus `[question]`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the `999Test` environment-variable case in kubeval and compare its result with the validation performed by `helm upgrade`. Read the linked Kubernetes v1.11 EnvVar specification and determine whether kubeval can apply the same name validation; done means establishing and documenting the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
cli, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.