Skip to content

fix(workloads): aggregate restore status for instance API - #10831

Merged
leon-ape merged 3 commits into
mainfrom
bugfix/its2-restore-condition
Sep 1, 2026
Merged

fix(workloads): aggregate restore status for instance API#10831
leon-ape merged 3 commits into
mainfrom
bugfix/its2-restore-condition

Conversation

@leon-ape

@leon-ape leon-ape commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Closes #10832

What this PR does

Completes the restore status aggregation path for workloads using the Instance API:

  • aggregates target PVC Restore conditions into each Instance
  • aggregates desired Instance Restore conditions into InstanceSet
  • preserves failure-first terminal semantics
  • reports Restore status even before the workload Pod/Instance exists

This restores the expected status flow:

PVC -> Instance -> InstanceSet -> Component -> Cluster

Why

The Instance/InstanceSet v2 path did not publish InstanceRestore conditions. A physical PVC restore could finish while Component and Cluster remained Restore=Unknown, leaving restore intent and protection finalizers behind.

Tests

  • codex-go-test.sh ./pkg/controller/instance ./pkg/controller/instanceset2 -count=1

Dependency

This is a prerequisite for #10777. #10777 should not merge before this fix is in main.

@leon-ape
leon-ape requested a review from a team as a code owner August 31, 2026 09:26
@github-actions github-actions Bot added the size/L Denotes a PR that changes 100-499 lines. label Aug 31, 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

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.78378% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.80%. Comparing base (27618c3) to head (92903c7).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pkg/controller/instanceset2/reconciler_status.go 78.48% 12 Missing and 5 partials ⚠️
pkg/controller/instance/reconciler_status.go 89.85% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10831      +/-   ##
==========================================
+ Coverage   65.66%   65.80%   +0.13%     
==========================================
  Files         510      510              
  Lines       64405    64698     +293     
==========================================
+ Hits        42294    42573     +279     
- Misses      18360    18370      +10     
- Partials     3751     3755       +4     
Flag Coverage Δ
unittests 65.80% <83.78%> (+0.13%) ⬆️

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 commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

/approve

@apecloud-bot apecloud-bot added the approved PR Approved Test label Sep 1, 2026
@leon-ape
leon-ape merged commit cdc2d7d into main Sep 1, 2026
49 of 51 checks passed
@leon-ape
leon-ape deleted the bugfix/its2-restore-condition branch September 1, 2026 05:17
@github-actions github-actions Bot added this to the Release 1.2.0 milestone Sep 1, 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.

Instance API restore status is not aggregated to Component

2 participants