fix: pass ForceConflicts to KubeClient.Create on install#32070
Draft
fix: pass ForceConflicts to KubeClient.Create on install#32070
Conversation
Signed-off-by: Tarun Gupta Akirala <tarun.akirala@nutanix.com>
Add tests to confirm that Install.ForceConflicts propagates to KubeClient.Create during performInstall when no existing resources need adoption (the fresh-install code path). - Add ResolveCreateOptions helper to kube package for test inspection - Record per-call ClientCreateOptions in FailingKubeClient - Add createNewResourceList helper returning NotFound from the fake REST client so resources flow through the Create path - TestInstallRelease_ForceConflictsPassedToCreate: SSA + ForceConflicts - TestInstallRelease_ForceConflictsFalseByDefault: SSA without force Made-with: Cursor
banjoh
requested changes
Apr 23, 2026
Contributor
There was a problem hiding this comment.
I left #32069 (comment) on the reported issue that this PR addresses
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
When
Install.ServerSideApplyis enabled, theperformInstallfunction inpkg/action/install.gohardcodesforceConflicts: falsein theKubeClient.Createcall for the fresh-install path (no resources to adopt). This meansInstall.ForceConflictsis silently ignored on initial resource creation, even though it is correctly forwarded on theUpdatepath for adopted resources.This causes SSA field-ownership conflicts to fail the install permanently when another controller has already claimed a field on a resource that the chart is also templating. The conflict cannot be resolved because Helm never forces through it on the Create path.
Changes
pkg/action/install.go: Replace the hardcodedfalsewithi.ForceConflictsso the caller's intent is honoured on both the Create and Update paths.pkg/action/install_test.go: AddTestInstallRelease_ForceConflictsPassedToCreateandTestInstallRelease_ForceConflictsFalseByDefaultto verify the option propagates correctly.pkg/kube/client.go: AddResolveCreateOptionstest helper to inspect resolved option values.pkg/kube/fake/failing_kube_client.go: RecordClientCreateOptionper Create call for test assertion.Related
Fixes #32069
Test plan
go test ./pkg/action/ -run TestInstallRelease_ForceConflicts -v— both new tests passgo test ./pkg/action/ -v— full action test suite passesgo test ./pkg/kube/...— kube package tests passMade with Cursor