fix(controller): patch CR metadata without owning spec (release-1.0)#10265
fix(controller): patch CR metadata without owning spec (release-1.0)#10265weicao wants to merge 1 commit into
Conversation
|
Auto Cherry-pick Instructions |
|
LGTM (peer review, 不能 formal approve 因为共享 GitHub identity). Backport verification vs PR #10264 (main):
Metadata clean:
Boundary: PR body 已写明 release-1.0 backport + live helm in-place upgrade validation 由 release-1.0 patch image 兜底(Tom mix-A-1 现场已 ready to rebuild from this head)。 CI 排队中,mergeStateStatus=BLOCKED 仅 formal review gate。 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-1.0 #10265 +/- ##
===============================================
+ Coverage 53.78% 53.82% +0.04%
===============================================
Files 493 493
Lines 55343 55346 +3
===============================================
+ Hits 29765 29789 +24
+ Misses 22608 22578 -30
- Partials 2970 2979 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Live verification — PASS (release-1.0 patch image + idc2 sqlserver vcluster, mix-A-1 v18 in-place helm upgrade scenario)
managedFields ownership delta — kubeblocks no longer claims any
Evidence pack: 13 files including identity, helm install/upgrade logs with rc, 4 before-*.json + 4 after-*.json managedFields snapshots, and CLOSEOUT-v1-pr10265-VERIFIED.md. tar sha256 PR #10265 mechanism proven live; PR body's Boundary item ("Live Helm in-place upgrade validation should be run with a patch image") is satisfied. |
|
Closing this manual release-1.0 backport to avoid a duplicate long-lived PR. The main PR is #10264. Backports should be generated from the main PR via The live validation evidence remains useful and is already cross-referenced from #10264. If auto-pick fails, this branch can be used as fallback evidence / reference, but it should not stay open in parallel with the normal backport flow. |
Summary
release-1.0.Updatecalls in finalizer handling with metadata-only merge patches.ComponentVersionsupported ComponentDefinition metadata updates with a metadata-only merge patch.Context
SQL Server addon in-place upgrade can fail with server-side apply field ownership conflicts after the controller reconciles chart-rendered definition objects. The conflicting fields are chart-owned spec fields, but whole-object controller updates can make apiserver managedFields record them under the
kubeblocksmanager.This backport keeps controller writes scoped to metadata when the controller only changes finalizers, labels, or annotations. It preserves chart ownership of rendered spec fields during Helm upgrades.
Validation
go test ./pkg/controllerutil -run TestHandleCRDeletionPatchesFinalizerMetadata -count=1 -vgo test ./controllers/apps -run TestComponentVersionSupportedCompDefLabelsUsesMetadataPatch -count=1 -vgo test -c ./controllers/appsgo test -c ./pkg/controllerutilgit diff --checkBoundary
This PR is a release-1.0 backport of #10264. Live Helm in-place upgrade validation for the SQL Server addon will be run with a release-1.0 patch image after this PR head is available.