Nested value objects stay open, so a misspelled nested key passes the schema
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 58/100
Research direction
Start by reading how helm-schema statically analyzes chart templates and generates nested object schemas, including the handling of .Values.image.repository and .Values.image.tag. Reproduce with the supplied chart and compare the generated schema under the default, lean, and full profiles. Done means image.tagg is rejected while objects consumed whole by toYaml, range, or another template remain open.
Written by the indexing model from the issue text.
Description
The generated schema closes the root object (additionalProperties: false), so a misspelled top-level key fails helm install. Every nested object stays open (additionalProperties: {}), though, even when the templates read each of its keys by name. So a misspelled nested key passes silently, and the chart renders with the default instead.
For example, a misspelled image.tag deploys the default image without any warning.
Repro
Chart.yaml:
apiVersion: v2
name: repro
version: 0.1.0
values.yaml:
replicaCount: 1
image:
repository: nginx
tag: "1.27"
templates/deployment.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: repro
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: repro
template:
metadata:
labels:
app: repro
spec:
containers:
- name: app
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
helm-schema . --output values.schema.json # same with --profile lean and --profile full
helm template x . --set imagee.tag=oops # rejected: additional properties 'imagee' not allowed
helm template x . --set image.tagg=oops # accepted
With helm-schema 0.0.7, the generated schema has "additionalProperties": false at the root but "additionalProperties": {} on image.
Expected
An object whose keys the templates only ever read by name (.Values.image.repository, .Values.image.tag) should be closed like the root, so image.tagg is rejected.
It should stay open only where something consumes it whole, such as toYaml .Values.podAnnotations, range over it, or passing it to another template.
- Dominant language
- Rust
- Stars
- 5
- Forks
- 0
- Avg merge
- 1h 31m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from romnn/helm-schema
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 57/100
romnn/helm-schema#4 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
romnn/helm-schema#3 ·
All issues in romnn/helm-schema
Similar issues
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
pbakaus/impeccable#1601 ·
Maintainers usually reply within 1 day
-
RDF/XML writer: a blank node in two lists is left out of the secondPossibly taken @mrnolte claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
phillord/horned-owl#368 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mongodb/kingfisher#588 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug rust
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days