Skip to content

fix(dataprotection): preserve backup namespace for cross-namespace restores - #10833

Merged
leon-ape merged 4 commits into
release-1.1from
bugfix/cross-namespace-backup-restore-release-1.1
Sep 1, 2026
Merged

fix(dataprotection): preserve backup namespace for cross-namespace restores#10833
leon-ape merged 4 commits into
release-1.1from
bugfix/cross-namespace-backup-restore-release-1.1

Conversation

@leon-ape

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

Copy link
Copy Markdown
Collaborator

Backport of #10827 for release-1.1; related issue: #10829.

The final #10827 diff cannot be cherry-picked cleanly onto this branch: it conflicts in pkg/controller/plan/restore_test.go, and pkg/dataprotection/restore/utils_test.go is absent from the original release base. This PR applies the same behavior to the release-specific controller layout and keeps tests in the standard restore_test.go, utils_test.go, and manager_test.go files.

What changed

  • Preserve the referenced Backup namespace in the release-specific preview, prepare-data, and post-ready Restore paths.
  • Keep the existing default support for non-VolumeSnapshot cross-namespace Backup references; do not introduce ReferenceGrant or a new authorization contract.
  • Keep the existing TODO for a future general cross-namespace permission check.
  • Resolve the complete restore dependency chain before rejecting cross-namespace VolumeSnapshot Backups, including PITR-selected base snapshots.
  • Preserve the VolumeSnapshot marker on continuous restore base Backup sets.
  • Reject a PITR-selected base Backup without status.backupMethod with a fatal error instead of panicking while reading snapshotVolumes.
  • Explicitly document cross-namespace VolumeSnapshot restore as NOT supported and regenerate CRDs and API reference docs.
  • Keep the focused tests aligned with fix(dataprotection): preserve backup namespace for cross-namespace restores #10827 and place them in the standard test files.
  • Synchronize the branch with the latest release-1.1, retaining both sides of the utils_test.go additions.

Validation

  • scripts/codex-go-test.sh ./pkg/dataprotection/restore ./pkg/controller/plan ./controllers/dataprotection ./pkg/operations -count=1
  • make manifests
  • make doc
  • git diff --check

All targeted tests pass.

@leon-ape
leon-ape requested review from a team, ldming and wangyelei as code owners August 31, 2026 10:14
@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

@leon-ape leon-ape changed the title fix: preserve cross-namespace backup restores (release-1.1) chore(dataprotection): backport cross-namespace restore fix to 1.1 Aug 31, 2026
@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.70%. Comparing base (619a34a) to head (c3118cf).

Files with missing lines Patch % Lines
pkg/dataprotection/restore/utils.go 70.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           release-1.1   #10833   +/-   ##
============================================
  Coverage        55.69%   55.70%           
============================================
  Files              550      550           
  Lines            62421    62434   +13     
============================================
+ Hits             34767    34777   +10     
- Misses           24334    24345   +11     
+ Partials          3320     3312    -8     
Flag Coverage Δ
unittests 55.70% <87.50%> (+<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.

@leon-ape leon-ape added the nopick Not auto cherry-pick when PR merged label Aug 31, 2026
@leon-ape

Copy link
Copy Markdown
Collaborator Author

/approve

@apecloud-bot apecloud-bot added the approved PR Approved Test label Aug 31, 2026
@leon-ape leon-ape changed the title chore(dataprotection): backport cross-namespace restore fix to 1.1 fix(dataprotection): preserve backup namespace for cross-namespace restores Aug 31, 2026
@leon-ape leon-ape added this to the Release 1.1.0 milestone Aug 31, 2026
@apecloud-bot apecloud-bot removed the approved PR Approved Test label Sep 1, 2026
…amespace-backup-restore-release-1.1

# Conflicts:
#	pkg/dataprotection/restore/utils_test.go
@leon-ape
leon-ape merged commit 3ec34e3 into release-1.1 Sep 1, 2026
24 checks passed
@leon-ape
leon-ape deleted the bugfix/cross-namespace-backup-restore-release-1.1 branch September 1, 2026 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Cross-namespace Backup restores need correct namespace and authorization

2 participants