Skip to content

fix: pass ForceConflicts to KubeClient.Create on install#32070

Draft
takirala wants to merge 2 commits intohelm:mainfrom
takirala:tga/fix-install-force-conflict-field
Draft

fix: pass ForceConflicts to KubeClient.Create on install#32070
takirala wants to merge 2 commits intohelm:mainfrom
takirala:tga/fix-install-force-conflict-field

Conversation

@takirala
Copy link
Copy Markdown

Summary

When Install.ServerSideApply is enabled, the performInstall function in pkg/action/install.go hardcodes forceConflicts: false in the KubeClient.Create call for the fresh-install path (no resources to adopt). This means Install.ForceConflicts is silently ignored on initial resource creation, even though it is correctly forwarded on the Update path 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 hardcoded false with i.ForceConflicts so the caller's intent is honoured on both the Create and Update paths.
  • pkg/action/install_test.go: Add TestInstallRelease_ForceConflictsPassedToCreate and TestInstallRelease_ForceConflictsFalseByDefault to verify the option propagates correctly.
  • pkg/kube/client.go: Add ResolveCreateOptions test helper to inspect resolved option values.
  • pkg/kube/fake/failing_kube_client.go: Record ClientCreateOption per Create call for test assertion.

Related

Fixes #32069

Test plan

  • go test ./pkg/action/ -run TestInstallRelease_ForceConflicts -v — both new tests pass
  • go test ./pkg/action/ -v — full action test suite passes
  • go test ./pkg/kube/... — kube package tests pass

Made with Cursor

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
@pull-request-size pull-request-size Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 23, 2026
Copy link
Copy Markdown
Contributor

@banjoh banjoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left #32069 (comment) on the reported issue that this PR addresses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Install.performInstall hardcodes forceConflicts: false on the Create path, ignoring Install.ForceConflicts

2 participants