Skip to content

fix: multi-cluster lifecycle pod placement - #10450

Merged
leon-ape merged 8 commits into
mainfrom
bugfix/multicluster-lifecycle-placement
Jun 29, 2026
Merged

fix: multi-cluster lifecycle pod placement#10450
leon-ape merged 8 commits into
mainfrom
bugfix/multicluster-lifecycle-placement

Conversation

@leon-ape

@leon-ape leon-ape commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add component.ListOwnedInstances to centralize Component instance Pod listing
  • resolve a scoped multi-cluster data context from the Component and related workload objects before listing instance Pods
  • switch Component lifecycle, replica status, and workload ops paths to use the shared helper
  • keep Instance and InstanceSet controller contexts local; the multi-cluster ITS path runs through InstanceSetReconciler2 and existing object-tree/graph data-context handling
  • add fake multi-cluster regression coverage for Component placement and running InstanceSet placement fallback

Root cause

Component lifecycle actions need concrete Pods, but Component reconcile intentionally does not carry global multi-cluster placement. In multi-cluster deployments, direct Pod listing with InDataContext() could therefore resolve no data clusters and return no Pods, blocking account provision before the InstanceSet update was built.

Fix

The fix keeps multi-cluster awareness local to Component instance discovery. ListOwnedInstances derives placement from the Component first, then falls back to related workload objects such as running/proto InstanceSets, and uses that scoped context only for listing the instance Pods needed by lifecycle and ops paths.

Validation

  • go test ./pkg/controller/component
  • go test ./controllers/apps/component
  • previously: go test ./pkg/controller/component ./controllers/apps/component ./pkg/controller/instanceset ./pkg/controller/instanceset2 ./pkg/controller/instance

Fixes #10440

@github-actions github-actions Bot added the size/L Denotes a PR that changes 100-499 lines. label Jun 24, 2026
@apecloud-bot

Copy link
Copy Markdown
Collaborator

Auto Cherry-pick Instructions

Usage:
  - /nopick: Not auto cherry-pick when PR merged.
  - /pick: release-x.x [release-x.x]: Auto cherry-pick to the specified branch when PR merged.

Example:
  - /nopick
  - /pick release-1.1

CLA Recheck Instructions

Usage:
  - /recheck-cla: Trigger a re-check of CLA status for this pull request.
Example:
  - /recheck-cla

@leon-ape leon-ape changed the title fix multi-cluster lifecycle pod placement fix: multi-cluster lifecycle pod placement Jun 24, 2026
@leon-ape leon-ape added the nopick Not auto cherry-pick when PR merged label Jun 24, 2026
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.21277% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.79%. Comparing base (d491444) to head (98dbf3a).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
pkg/controller/component/utils.go 66.66% 5 Missing and 1 partial ⚠️
pkg/controller/component/workload.go 45.45% 4 Missing and 2 partials ⚠️
...s/apps/component/transformer_component_workload.go 66.66% 0 Missing and 1 partial ⚠️
pkg/controller/component/component.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10450      +/-   ##
==========================================
+ Coverage   62.08%   62.79%   +0.70%     
==========================================
  Files         533      533              
  Lines       63709    64232     +523     
==========================================
+ Hits        39554    40334     +780     
+ Misses      20553    20327     -226     
+ Partials     3602     3571      -31     
Flag Coverage Δ
unittests 62.79% <70.21%> (+0.70%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leon-ape
leon-ape marked this pull request as ready for review June 24, 2026 03:43
@leon-ape
leon-ape requested a review from a team as a code owner June 24, 2026 03:43
@leon-ape

Copy link
Copy Markdown
Collaborator Author

/approve

@apecloud-bot apecloud-bot added the approved PR Approved Test label Jun 24, 2026
@apecloud-bot apecloud-bot removed the approved PR Approved Test label Jun 29, 2026
@github-actions github-actions Bot added size/M Denotes a PR that changes 30-99 lines. and removed size/L Denotes a PR that changes 100-499 lines. labels Jun 29, 2026
@leon-ape

Copy link
Copy Markdown
Collaborator Author

/approve

@apecloud-bot apecloud-bot added the approved PR Approved Test label Jun 29, 2026
@github-actions github-actions Bot added size/L Denotes a PR that changes 100-499 lines. and removed size/M Denotes a PR that changes 30-99 lines. labels Jun 29, 2026
@apecloud-bot apecloud-bot removed the approved PR Approved Test label Jun 29, 2026
@leon-ape

Copy link
Copy Markdown
Collaborator Author

/approve

@apecloud-bot apecloud-bot added the approved PR Approved Test label Jun 29, 2026
@leon-ape
leon-ape merged commit 138ea3a into main Jun 29, 2026
38 checks passed
@leon-ape
leon-ape deleted the bugfix/multicluster-lifecycle-placement branch June 29, 2026 07:38
@github-actions github-actions Bot added this to the Release 1.2.0 milestone Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved PR Approved Test nopick Not auto cherry-pick when PR merged size/L Denotes a PR that changes 100-499 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] multi-cluster: hscale ops hang

2 participants