Repository navigation
fix: deep copy values on merge so a chart mapping can't leak into later components - #5585
Merged
Merged
Conversation
…er components Signed-off-by: Allen Conlon <software@conlon.dev>
✅ Deploy Preview for zarf-docs canceled.
|
Codecov Report❌ Patch coverage is
... and 34 files with indirect coverage changes 🚀 New features to boost your workflow:
|
dwertent
reviewed
Nov 3, 2026
Signed-off-by: Allen Conlon <software@conlon.dev>
dwertent
reviewed
Nov 4, 2026
Signed-off-by: Allen Conlon <software@conlon.dev>
brandtkeller
requested changes
Nov 5, 2026
brandtkeller
left a comment
Member
There was a problem hiding this comment.
one minor and possibly negligible item I wanted to discuss otherwise lgtm.
Signed-off-by: Allen Conlon <software@conlon.dev>
AustinAbro321
approved these changes
Nov 5, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 5, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 5, 2026
Member
Author
|
Is there something that I could change to help this merge? |
Member
|
Nah, gh download links were returning 500 |
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 5, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Values.DeepMergeandValues.Setstored source subtrees by reference, so a destination shared nested maps with its source.In
generateValuesOverrides, a chart's firstvaluesmapping (.shared→.) madechartOverrides["nested"]the same map object as the package values tree'sshared.nested. The second mapping (.extra→.) then foundnestedpresent in both, recursed, and wrotefrom-extrastraight into the package values. Every later component reading.sharedgot the first component's values, so a render depended on which components were in the command — and the wrong values reached the cluster with no warning.This also explains why the bug only ever touched nested keys (a top-level key is overwritten in
chartOverridesitself, not in the shared tree) and why inspecting a single component looked correct.The fix stores
deepCopyValue(...)instead of the reference, using the helper already in that file. That makes the wholeValuesAPI non-aliasing, so no caller can splice a live subtree into a destination and later write through it. It also closes the same aliasing one layer over, atpackager.go:105, where the long-lived per-commandvaluesOverridesMapis merged by reference into the map handed to Helm.The same bug class was patched at this call site once before, for
excludePaths— hence fixing the primitive rather than the caller.Secondary effect: the
zarf-seed-registry/zarf-registrycase from the issue now works. Giving the seed registry its own values path no longer rewrites.registry's nestedpersistence/autoscalingmaps.Tests — each was confirmed to fail before the
value.gochange and pass after:src/pkg/value/value_test.go—DeepMerge/Setmust not hand the destination a live reference into the source.src/pkg/packager/packager_test.go— the issue's scenario at unit level: comp-a's mapping must leave the shared tree untouched, and comp-b must resolvenested.bothtofrom-shared.src/test/e2e/42_values_test.go+src/test/packages/42-values/values-leak/—package createthenpackage inspect values-files, asserting comp-b's document is identical whether or not comp-a is in the same command. The fixture was validated against a pre-fix binary and reproduced the issue's output exactly.Related Issue
Fixes #5584
Checklist before merging