Skip to content

fix: honor release-level takeOwnership false over helmDefaults - #2838

Merged
yxxhero merged 2 commits into
helmfile:mainfrom
spicysharkco:fix/release-take-ownership
Oct 21, 2026
Merged

yxxhero merged 2 commits into
helmfile:mainfrom
spicysharkco:fix/release-take-ownership

Conversation

@spicysharkco

Copy link
Copy Markdown
Contributor

Problem

Follow-up to the review note on #2837: takeOwnership has the same precedence gap that skipSchemaValidation had.

helmDefaults:
  takeOwnership: true
releases:
- name: app
  chart: ./app
  takeOwnership: false

The release-level false fell through to the default in both upgrades and helmfile diff, so both paths appended --take-ownership.

Solution

Gate the defaults branch on the release value being unset in the upgrade resolver and diff resolver. The command-line flag still wins, and unset releases still inherit defaults.

Test

go test ./pkg/state -run '^(TestAppendTakeOwnershipFlagsForUpgrade|TestAppendTakeOwnershipFlagsForDiff)$' -count=1 -v -timeout 300s -p 1 — with both fixes reverted, 2/9 rows failed in each of three runs; after restoration, 9/9 passed in each run.

go test ./pkg/state -count=1 -p 1 -timeout 590s — passed.

An explicit release takeOwnership false now prevents helmDefaults from
adding --take-ownership to upgrades and helmfile diff. 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 0d5311b 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