Opt-in to accept duplicate keys in values.yaml, as Helm does

Open
#3 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
helm, rust
Domain
build-system, cli

Research direction

Start by tracing the CLI argument handling and the YAML deserialization path for the chart’s own values.yaml and dependency values, including where the duplicate-key error is raised. Check how dependency values are merged and how warnings are reported. Done means an opt-in flag can allow last-occurrence-wins parsing, report the file, key and both lines, and be scoped to one dependency or dependency charts while strict rejection remains the default.

Written by the indexing model from the issue text.

Description

enhancement

Observed

helm-schema aborts when a dependency chart's values.yaml repeats a key:

Error: Yaml(Error("duplicate entry with key \"additionalLabels\"", line: 1, column: 1))

The upstream qdrant chart 1.16.3 (https://qdrant.to/helm) declares the top-level additionalLabels: {} twice, on lines 16 and 85 of its values.yaml. Helm, helm lint and yq all accept the chart, and 1.17.1 fixed it upstream, but a chart that depends on qdrant 1.16.3 cannot generate a schema. Qdrant can only be upgraded one minor version at a time, so every 1.15 → 1.17 upgrade has to pass through this chart.

Expected

An opt-in flag, such as --allow-duplicate-keys, that parses duplicate mapping keys the way Helm does (the last occurrence wins) and prints a warning naming the file, the key and both lines. Strict rejection stays the default, since a duplicate key in a chart we own is usually a mistake.

Reproduce

helm pull qdrant --repo https://qdrant.to/helm --version 1.16.3 --untar
helm-schema ./qdrant --output /tmp/values.schema.json

The same happens for a parent chart that lists qdrant 1.16.3 as a dependency, as in deployment/charts/qdrant in the luup repository.

Where

The values YAML is deserialized strictly (the error comes from the YAML deserializer's duplicate-key check), for both the chart's own values.yaml and the dependency charts' values that get merged in. The flag should also be settable for one dependency only, or only for dependency charts, so our own charts stay strict.

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from romnn/helm-schema

All issues in romnn/helm-schema

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.