mirror of https://github.com/helm/helm
Fix #32530: preserve null values in top-level chart values.yaml
Since Helm 4.2.0, null-valued keys defined directly in the top-level chart's
own values.yaml were being removed from `.Values` during coalescing. For
example:
```yaml
stuff:
foo: bar
baz: null
foobar: null
```
would render `{"stuff":{"foo":"bar"}}` instead of
`{"foobar":null,"stuff":{"baz":null,"foo":"bar"}}`.
The root cause is in `coalesceValues`: the nil-skipping and `cleanNilValues`
cleanup applied to `val == nil` keys was being applied unconditionally to the
top-level chart's own defaults, not just to subchart defaults.
This change restricts the nil cleanup to subchart coalescing (`prefix != ""`),
so null values defined directly in the top-level chart's values.yaml are now
preserved. Subchart default nils are still cleaned as before, retaining the
in-place delete behavior from the `cleanNilValues` path.
Adds a regression test covering both a top-level null key and a nested null
key. Restores the pre-4.2.0 behavior described in the issue.
Signed-off-by: waterWang
pull/32531/head
parent
f3d68cdbea
commit
e35f6bb312
Loading…
Reference in new issue