close
Skip to content

chore: switch restore ops to cluster restore API#10246

Open
leon-ape wants to merge 1 commit into
support/dp-backup-pvc-restorefrom
support/restore-legacy-cleanup
Open

chore: switch restore ops to cluster restore API#10246
leon-ape wants to merge 1 commit into
support/dp-backup-pvc-restorefrom
support/restore-legacy-cleanup

Conversation

@leon-ape
Copy link
Copy Markdown
Contributor

@leon-ape leon-ape commented May 18, 2026

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 generate
  • make manifests
  • make doc
  • make fmt
  • make lint
  • KUBEBUILDER_ASSETS="/Users/leon/Library/Application Support/io.kubebuilder.envtest/k8s/1.26.1-darwin-arm64" go test ./pkg/operations -run TestAPIs
  • KUBEBUILDER_ASSETS="/Users/leon/Library/Application Support/io.kubebuilder.envtest/k8s/1.26.1-darwin-arm64" go test ./pkg/controller/plan
  • KUBEBUILDER_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
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 67.64706% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.65%. Comparing base (3a0cd73) to head (5b8cfb5).

Files with missing lines Patch % Lines
pkg/operations/restore.go 81.17% 10 Missing and 6 partials ⚠️
pkg/controller/plan/restore.go 0.00% 13 Missing ⚠️
pkg/operations/horizontal_scaling.go 0.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@                        Coverage Diff                        @@
##           support/dp-backup-pvc-restore   #10246      +/-   ##
=================================================================
- Coverage                          53.03%   52.65%   -0.39%     
=================================================================
  Files                                533      533              
  Lines                              62596    62498      -98     
=================================================================
- Hits                               33200    32910     -290     
- Misses                             25998    26219     +221     
+ Partials                            3398     3369      -29     
Flag Coverage Δ
unittests 52.65% <67.64%> (-0.39%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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 force-pushed the support/dp-backup-pvc-restore branch from 44ab657 to 0120931 Compare May 18, 2026 12:41
@leon-ape leon-ape force-pushed the support/restore-legacy-cleanup branch from 54abdc3 to e01911c Compare May 18, 2026 12:45
@leon-ape leon-ape force-pushed the support/dp-backup-pvc-restore branch from 0120931 to 3a0cd73 Compare May 18, 2026 12:59
@leon-ape leon-ape force-pushed the support/restore-legacy-cleanup branch from e01911c to 5b8cfb5 Compare May 18, 2026 12:59
@leon-ape leon-ape changed the title refactor: switch restore ops to cluster restore API chore: switch restore ops to cluster restore API May 19, 2026
@leon-ape leon-ape force-pushed the support/restore-legacy-cleanup branch from 5b8cfb5 to ded02d3 Compare May 20, 2026 01:20
@leon-ape leon-ape force-pushed the support/dp-backup-pvc-restore branch from 3a0cd73 to 404c845 Compare May 20, 2026 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant