Skip to content

[v3 backport] fix(values): preserve nil values when chart default is empty map#31829

Merged
TerryHowe merged 6 commits intohelm:dev-v3from
nokia:fix-nil-values
Feb 11, 2026
Merged

[v3 backport] fix(values): preserve nil values when chart default is empty map#31829
TerryHowe merged 6 commits intohelm:dev-v3from
nokia:fix-nil-values

Conversation

@KrzysztofDziankowski
Copy link
Copy Markdown

What this PR does / why we need it:
It is a backport of a fix for issue #31644

Special notes for your reviewer:
All commits from #31644 were back-ported 1 to 1 without any additional changes.

If applicable:

  • this PR contains user facing changes (the docs needed label should be applied if so)
  • this PR contains unit tests
  • this PR has been tested for backwards compatibility

banjoh and others added 6 commits February 9, 2026 16:33
Only delete nil user values when overriding a non-nil chart default.
When chart has empty map or no default for a key, preserve user's nil.

| Scenario | Result |
|----------|--------|
| User sets `baz: ~`, chart has `baz: "value"` | Key deleted |
| User sets `baz: ~`, chart has empty map `{}` | Nil preserved |
| User sets `baz: ~`, chart has `baz: ~` | Nil preserved |

Fixes helm#31643

Signed-off-by: Evans Mungai <mbuevans@gmail.com>
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
Co-authored-by: George Jenkins <gvjenkins@gmail.com>
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 11, 2026
Copy link
Copy Markdown
Contributor

@TerryHowe TerryHowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good, but your going to have to put this to the dev-v3 branch

@KrzysztofDziankowski KrzysztofDziankowski changed the base branch from release-3.20 to dev-v3 February 11, 2026 15:08
@KrzysztofDziankowski
Copy link
Copy Markdown
Author

@TerryHowe I changed target branch to dev-v3 in this PR.

Copy link
Copy Markdown
Contributor

@banjoh banjoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@TerryHowe TerryHowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Thanks!

@TerryHowe TerryHowe merged commit 16feecf into helm:dev-v3 Feb 11, 2026
2 checks passed
@banjoh banjoh added this to the 3.20.1 milestone Feb 16, 2026
@scottrigby scottrigby changed the title fix(values): preserve nil values when chart default is empty map - 3.20 backport [v3 backport] fix(values): preserve nil values when chart default is empty map Mar 10, 2026
@scottrigby scottrigby added bug Categorizes issue or PR as related to a bug. needs-pick Indicates that a PR needs to be cherry-picked into the next release candidate. labels Mar 10, 2026
@scottrigby scottrigby modified the milestones: 3.20.1, 3.20.2 Mar 11, 2026
@scottrigby scottrigby added picked Indicates that a PR has been cherry-picked into the next release candidate. and removed needs-pick Indicates that a PR needs to be cherry-picked into the next release candidate. labels Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Categorizes issue or PR as related to a bug. picked Indicates that a PR has been cherry-picked into the next release candidate. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants