chore: project cluster restore intent in apps
Summary
This PR implements apps-side support for the new Cluster.spec.restore API.
It is intentionally additive: the existing kubeblocks.io/restore-from-backup annotation path remains untouched and continues to work until the later cleanup/switch PR.
Changes
- Projects
Cluster.spec.restoreonto initial component, sharding, shard-template, and instance-template VCTs. - Propagates restore source, PITR, parameters, component, and volume-template metadata through VCT annotations.
- Sets PVC template
dataSourceReffrom the restore source. - Cleans restore intent from downstream VCTs after apps observes restore completion, preventing scale-out PVCs from restoring again.
- Aggregates restore progress through PVC condition -> InstanceSet condition -> Component condition -> Cluster condition.
- Adds tests for restore intent projection, cleanup, instance-template VCT handling, PVC template propagation, and restore condition aggregation.
Out of Scope
- DP Backup-kind PVC runtime implementation.
- Restore ops switch to
Cluster.spec.restore. - Removal of legacy restore annotation transformers, watches, constants, or utilities.
- System account restore behavior changes.
Validation
make generatemake manifestsmake docmake fmtmake lintgo test ./controllers/apps/cluster/...go test ./controllers/apps/component/...go test ./pkg/controller/instanceset ./pkg/controller/component ./pkg/controllerutil
Codecov Report
:x: Patch coverage is 77.52294% with 98 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 53.36%. Comparing base (7e2fd5a) to head (ec95951).
:warning: Report is 2 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #10244 +/- ##
==========================================
+ Coverage 53.00% 53.36% +0.35%
==========================================
Files 533 534 +1
Lines 61423 63313 +1890
==========================================
+ Hits 32560 33789 +1229
- Misses 25581 26088 +507
- Partials 3282 3436 +154
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 53.36% <77.52%> (+0.35%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
/approve
/recheck-cla
Recheck CLA triggered.