chore: switch restore ops to cluster restore API
Summary
Switch restore ops to the new Cluster restore API and remove the old annotation-based restore plumbing.
Changes
- Make restore ops build target Clusters with
spec.restore. - Make restore ops wait on apps restore condition plus final Cluster phase.
- Stop writing
kubeblocks.io/restore-from-backup. - Remove old restore annotation constants, backup source target bridge, and dead restore-manager annotation parsing.
- Keep h-scale behavior conservative: single backup target can be inferred, multi-target backups fail fast with a TODO for explicit source target selection.
- Update restore examples to use
Cluster.spec.restore.
Not included
- No new public API.
- No apps restore intent projection changes.
- No dataprotection Backup-kind PVC runtime changes.
Validation
make generatemake manifestsmake docmake fmtmake lintKUBEBUILDER_ASSETS="/Users/leon/Library/Application Support/io.kubebuilder.envtest/k8s/1.26.1-darwin-arm64" go test ./pkg/operations -run TestAPIsKUBEBUILDER_ASSETS="/Users/leon/Library/Application Support/io.kubebuilder.envtest/k8s/1.26.1-darwin-arm64" go test ./pkg/controller/planKUBEBUILDER_ASSETS="/Users/leon/Library/Application Support/io.kubebuilder.envtest/k8s/1.26.1-darwin-arm64" go test ./controllers/dataprotection ./controllers/apps/cluster/... ./controllers/apps/component/...
Diff audit
Compared with the original large branch, the stacked result only differs by generated InstanceSet CRD/API docs from make manifests/doc, a test-only removal of a DP constant import from pkg/controllerutil/volume_util_test.go, and deletion of the unused dataprotection.kubeblocks.io/volume-source parameter.
Codecov Report
:x: Patch coverage is 67.34694% with 48 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 53.17%. Comparing base (7e2fd5a) to head (464c29f).
:warning: Report is 2 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #10246 +/- ##
==========================================
+ Coverage 53.00% 53.17% +0.16%
==========================================
Files 533 532 -1
Lines 61423 62965 +1542
==========================================
+ Hits 32560 33481 +921
- Misses 25581 26081 +500
- Partials 3282 3403 +121
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 53.17% <67.34%> (+0.16%) |
: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