Skip to content

fix: honor release-level syncReleaseLabels false - #2839

Merged
yxxhero merged 2 commits into
helmfile:mainfrom
spicysharkco:fix/release-sync-release-labels-override
Oct 21, 2026
Merged

yxxhero merged 2 commits into
helmfile:mainfrom
spicysharkco:fix/release-sync-release-labels-override

Conversation

@spicysharkco

Copy link
Copy Markdown
Contributor

Problem

With:

helmDefaults:
  syncReleaseLabels: true
releases:
  - name: example
    syncReleaseLabels: false
    labels:
      app: test

Helmfile still passes --labels app=test. A release value should override helmDefaults, as it does for wait and waitForJobs. This is the same change #2837 made for skipSchemaValidation and #2838 makes for takeOwnership.

Solution

The resolver checked the release value only when true, so false fell through to helmDefaults. The defaults case now applies only when the release leaves syncReleaseLabels unset. The command-line flag keeps precedence.

Test

TestAppendLabelsFlags covers release false, release unset, release true, both unset, and the command-line flag.

go test ./pkg/state -run '^TestAppendLabelsFlags$' -count=1 -p 1

With the fix: 5 of 5 rows pass. With the fix reverted: the release false row fails and the other 4 pass.

An explicit release syncReleaseLabels false now prevents helmDefaults from
adding --labels. Unset releases still inherit the default, and the
command-line flag still takes precedence.

Signed-off-by: spicysharkco <[email protected]>
Applies the go fix modernizer rewrite the lint job checks for.

Signed-off-by: spicysharkco <[email protected]>
@yxxhero
yxxhero merged commit dfce9cf into helmfile:main Oct 21, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants