feat: add values.schema.json for strict Helm values validation#95
Conversation
Adds a JSON Schema that validates all 157 top-level values properties with additionalProperties: false at every object level. This catches typos and misspelled field names at install/upgrade time instead of silently dropping them. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Nice. How are you generating this? |
The schema is now generated by scripts/generate-schema.py which: - Scans all templates for .Values.* references - Infers types from template context (pgdog.intval → integer, toYaml → object, etc.) - Merges manually maintained overrides from scripts/schema-overrides.yaml (enums, descriptions, required fields, complex array item schemas) - Supports --check mode for CI to detect stale schemas Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
I added a 'generate schema' script together with an 'overrides' file for some other fields that the script was having trouble inferring properly. |
|
Aight, let's try this! Thanks for writing it up. Edit: Woops, couple CI failures (the test job) |
|
I'll fix the failures. |
queryParser was inferred as object due to `with .Values.queryParser` in the template — added explicit type: string override. otel.headers uses `range $k, $v` which doesn't match any object-detection pattern — added type: object override. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
validate-configs is failing with this error: "Error: Input required and not supplied: token". Is there something I need to do to get that to pass? |
|
That one is fine, doesn't work on forks :/ it'll run on main |
|
Is there anything else I should add or change here in order to get this merged? |
|
My bad. Merging now. |
|
We just upgraded and we're receiving the following error: This is how we have set up |
|
I created a PR to fix these cases: #103 |
Summary
values.schema.json(JSON Schema) that covers all 157 top-level values properties used across templatesadditionalProperties: falseat every object level so typos and misspelled field names are caught athelm install/helm upgradetime instead of being silently droppedlogLevel,logFormat,pullPolicy), and range validations where applicableMotivation
Without a schema, Helm silently ignores unknown values keys. A misspelled field name (e.g.
iamgeinstead ofimage) passes without error and the intended configuration is never applied.Validation
helm lint .passes with default valueshelm templaterenders successfully with default values andexamples/full-example.yamlTest plan
helm lint .passeshelm template test .renders successfullyhelm template test . -f examples/full-example.yamlrenders successfullyhelm template test . --set typoField=trueis rejected🤖 Generated with Claude Code