fix: preserve YAML anchors after Helm v4 List unwrap in post-render - #1558
Closed
zanarellidev wants to merge 1 commit into
Closed
fix: preserve YAML anchors after Helm v4 List unwrap in post-render#1558zanarellidev wants to merge 1 commit into
zanarellidev wants to merge 1 commit into
Conversation
Helm v4 annotateAndMerge unwraps kind:List into separate documents while preserving &anchor/*alias markers. That creates cross-document aliases which OriginLabels (always on) rejects as unknown anchors. Inflate aliases in Combined.Run by re-wrapping into a List, DeAnchor, and re-serializing only when ParseAll fails with an unknown-anchor error. Signed-off-by: zanarelli <zanarelli.dev@gmail.com>
zanarellidev
force-pushed
the
fix/postrender-yaml-anchors
branch
from
August 2, 2026 18:41
e434170 to
79ac064
Compare
Member
|
Looks like the bug is in helm, not helm-controller |
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.
Summary
annotateAndMergeunwrapskind: Listinto separate documents while keeping&anchor/*aliasmarkers, which turns valid in-List aliases into cross-document references.NewResMapFromBytesfails withMalformedYAMLError: yaml: unknown anchor ... referencedeven when the HelmRelease has nopostRenderers.Combined.Runonly when parse fails with an unknown-anchor error: re-wrap documents as a List,DeAnchor, re-serialize.Fixes #1556
Bisect
main.v1.0.0.v1.5.0: Helmv4.1.x;v1.6.0: Helmv4.2.x). Helm v3 controllers did not unwrap List this way before post-render.Test plan
go test -count=1 ./internal/postrender/Test_OriginLabels_Run_crossDocAnchorsFromListUnwrap(exactunknown anchor 'jobSpec'without inflate)