[v0.14] Revert false-drift workaround and restore legacyscheme#5007
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Reverts the previously backported “false drift” workaround for legacy Fleet (v0.14) by restoring Kubernetes in-tree defaulting via legacyscheme, addressing drift side effects seen in chart deployments (e.g., #4969).
Changes:
- Switch diff defaulting scheme back from
client-goscheme tok8s.io/kubernetes/pkg/api/legacyscheme(with in-tree API installs). - Remove the live-object patch normalizations (replicas/HPA + null-field stripping) that were part of the prior workaround.
- Add
k8s.io/kubernetes(and related Kubernetes module pinning) to module deps; remove the related unit/e2e drift tests and assets.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/cmd/agent/deployer/internal/diff/scheme/scheme.go | Restores in-tree Kubernetes legacyscheme and installs to re-enable defaulting. |
| internal/cmd/agent/deployer/desiredset/diff.go | Removes extra patch normalization steps previously used to avoid false drift. |
| internal/cmd/agent/deployer/desiredset/diff_null_test.go | Deletes unit tests/benchmarks for null-field patch normalization (workaround removed). |
| e2e/single-cluster/helm_recreate_drift_test.go | Deletes e2e drift regression test related to Helm v4 null/defaulting behavior. |
| e2e/assets/helm-recreate-drift/** | Deletes e2e chart/assets used by the removed drift test. |
| e2e/assets/gitrepo/helm-recreate-drift-gitrepo.yaml | Deletes GitRepo template used by the removed drift test. |
| go.mod / go.sum | Adds k8s.io/kubernetes dependency and pins many Kubernetes modules. |
| integrationtests/go.mod / integrationtests/go.sum | Mirrors Kubernetes module pinning/dep changes for the integration test module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
weyfonk
approved these changes
Apr 17, 2026
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.
Reverting the move to client-go scheme, because client-go does not provide any Kubernetes config defaults which can have certain side effects for chart deployments, e.g. described in #4969.
Initially we have backported the fix for Fleet v0.15 upwards, but we decided to go back to the old behavior for legacy Fleet versions instead, to prevent any potential regressions by these changes.
Refers to #4969