Fix drift correction regression when correctDrift.force is false#4879
Merged
0xavi0 merged 3 commits intoMar 31, 2026
Conversation
The Helm v4 migration set ServerSideApply to "auto" for non-force rollbacks. This caused Helm to auto-detect and reuse the apply method from the original release, which is SSA. Server-Side Apply tracks field ownership per field manager, so rollback only reverts fields owned by Helm's manager — manual changes owned by a different manager are silently ignored. Setting ServerSideApply to "false" for all rollbacks forces client-side three-way merge, which compares the full resource state and patches all drifted fields regardless of ownership. This restores the Helm v3 behavior. Refers to: rancher#4878 Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
e441d38 to
dbb9c19
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a drift-correction regression introduced during the Helm v4 migration by ensuring rollbacks always use client-side three-way merge (disabling Server-Side Apply), so drifted fields get reverted even when field ownership differs.
Changes:
- Always set
Rollback.ServerSideApply = "false"during drift-correction rollbacks (regardless ofcorrectDrift.force). - Expand/adjust integration tests to cover additional drift scenarios (labels, replicas, deletions, keepFailHistory, multi-resource drift, pause/off-schedule behavior).
- Make the Service in the
deployment-v1test asset explicitly setspec.type: ClusterIP.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/helmdeployer/rollback.go | Forces client-side apply for rollback to restore Helm v3-like drift correction behavior when force is false. |
| integrationtests/agent/bundle_deployment_drift_test.go | Adds/updates drift-correction integration coverage for more drift modes and controller behaviors. |
| integrationtests/agent/assets/deployment-v1.yaml | Ensures the test Service explicitly includes spec.type for drift scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
weyfonk
approved these changes
Mar 27, 2026
| metadata: | ||
| name: svc-test | ||
| spec: | ||
| type: ClusterIP |
Contributor
There was a problem hiding this comment.
nit: this should not change anything, being the default (ref); but having it explicitly set doesn't harm :)
Edit: probably done to make the test case editing the service type work 👍
0xavi0
added a commit
to 0xavi0/fleet
that referenced
this pull request
Apr 7, 2026
…cher#4879) * Fix drift correction regression when correctDrift.force is false The Helm v4 migration set ServerSideApply to "auto" for non-force rollbacks. This caused Helm to auto-detect and reuse the apply method from the original release, which is SSA. Server-Side Apply tracks field ownership per field manager, so rollback only reverts fields owned by Helm's manager — manual changes owned by a different manager are silently ignored. Setting ServerSideApply to "false" for all rollbacks forces client-side three-way merge, which compares the full resource state and patches all drifted fields regardless of ownership. This restores the Helm v3 behavior. Refers to: rancher#4878 --------- Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
thardeck
pushed a commit
that referenced
this pull request
Apr 14, 2026
…) (#4939) * Fix drift correction regression when correctDrift.force is false The Helm v4 migration set ServerSideApply to "auto" for non-force rollbacks. This caused Helm to auto-detect and reuse the apply method from the original release, which is SSA. Server-Side Apply tracks field ownership per field manager, so rollback only reverts fields owned by Helm's manager — manual changes owned by a different manager are silently ignored. Setting ServerSideApply to "false" for all rollbacks forces client-side three-way merge, which compares the full resource state and patches all drifted fields regardless of ownership. This restores the Helm v3 behavior. Refers to: #4878 --------- Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
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.
The Helm v4 migration set ServerSideApply to "auto" for non-force rollbacks. This caused Helm to auto-detect and reuse the apply method from the original release, which is SSA. Server-Side Apply tracks field ownership per field manager, so rollback only reverts fields owned by Helm's manager — manual changes owned by a different manager are silently ignored.
Setting ServerSideApply to "false" for all rollbacks forces client-side three-way merge, which compares the full resource state and patches all drifted fields regardless of ownership. This restores the Helm v3 behavior.
Refers to: #4878
Additional Information
Checklist
- [ ] I have updated the documentation via a pull request in the fleet-product-docs repository.