Skip to content

refactor(controller): generalize Pod status synchronization - #939

Merged
furykerry merged 2 commits into
openkruise:masterfrom
ywExcellent:refactor/pod-status-sync-common
Sep 4, 2026
Merged

refactor(controller): generalize Pod status synchronization#939
furykerry merged 2 commits into
openkruise:masterfrom
ywExcellent:refactor/pod-status-sync-common

Conversation

@ywExcellent

Copy link
Copy Markdown
Contributor

Ⅰ. Describe what this PR does

Generalizes Pod status synchronization by replacing the Ready-only boolean with explicit synchronization options.

  • Separates Pod identity/IP synchronization from Ready-condition synchronization.
  • Adds an optional, backend-provided Pending Ready-condition projection and scoped cleanup for conditions owned by that projection.
  • Keeps upgrade resume and recreate paths limited to Pod identity/IP synchronization.

Ⅱ. Does this pull request fix one issue?

NONE

Ⅲ. Describe how to verify it

go test ./pkg/controller/sandbox/core -run 'Test(DefaultSyncStatusFromPodPendingProjection|DefaultSyncStatusFromPodSyncReadyWithoutPodInfo|CommonControl_EnsureSandbox(Running|Updated|Resumed)|PodFailure|EnsureSandboxUpgraded|PerformRecreateUpgrade_ContainerStatuses)' -count=1

Ⅳ. Special notes for reviews

  • PendingReadyCondition and OwnsPendingReadyReason provide a generic extension point for backend-specific Pending failures without adding provider dependencies to the common controller.
  • Cleanup is limited to the caller-owned Ready reason, preserving unrelated startup failures.

Signed-off-by: 少师 <zengyuwei.zyw@alibaba-inc.com>
@kruise-bot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign zmberg for approval by writing /assign @zmberg in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.09%. Comparing base (0ba722a) to head (62aba48).

Files with missing lines Patch % Lines
pkg/controller/sandbox/core/common_control.go 78.57% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #939      +/-   ##
==========================================
- Coverage   83.09%   83.09%   -0.01%     
==========================================
  Files         259      259              
  Lines       22545    22555      +10     
==========================================
+ Hits        18734    18741       +7     
- Misses       3090     3091       +1     
- Partials      721      723       +2     
Flag Coverage Δ
unittests 83.09% <78.57%> (-0.01%) ⬇️

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.

@kruise-bot kruise-bot added size/M and removed size/L labels Sep 4, 2026
Signed-off-by: 少师 <zengyuwei.zyw@alibaba-inc.com>
@ywExcellent
ywExcellent force-pushed the refactor/pod-status-sync-common branch from 8fa3b55 to 62aba48 Compare September 4, 2026 11:12
@furykerry
furykerry merged commit 1781b7c into openkruise:master Sep 4, 2026
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants