Remove Restic path for Pod Volume Restore#9662
Remove Restic path for Pod Volume Restore#9662testsabirweb wants to merge 2 commits intovelero-io:mainfrom
Conversation
Signed-off-by: Sabir Ali <sabir.ali@spectrocloud.com>
Signed-off-by: Sabir Ali <sabir.ali@spectrocloud.com>
86bbf28 to
aa5770a
Compare
- Reject restores from Restic PodVolumeBackups in the restorer; export ErrResticFileSystemBackupUnsupported with whole-pod messaging when any volume is Restic-backed (including mixed Kopia volumes). - Fail PodVolumeRestores with explicit Restic uploader in the advanced controller. - Disable legacy Restic-only async path (IsLegacyPVR always false); remove dead IsLegacyPVR handling in server and node-agent (markLegacyPVRsFailed). - Tests: restic unsupported paths, legacy enqueue, controller restic case. Signed-off-by: Sabir Ali <sabir.ali@spectrocloud.com>
Signed-off-by: Sabir Ali <sabir.ali@spectrocloud.com>
aa5770a to
cc9916d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9662 +/- ##
==========================================
+ Coverage 60.99% 61.03% +0.03%
==========================================
Files 387 387
Lines 36629 36599 -30
==========================================
- Hits 22341 22337 -4
+ Misses 12675 12649 -26
Partials 1613 1613 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| func IsLegacyPVR(pvr *velerov1api.PodVolumeRestore) bool { | ||
| return pvr.Spec.UploaderType == uploader.ResticType | ||
| // IsLegacyPVR reports whether the PodVolumeRestore uses the legacy async reconcile path. |
There was a problem hiding this comment.
This pod_volume_restore_controller_legacy.go file could be fully removed.
| log = log.WithField("restore", fmt.Sprintf("%s/%s", pvr.Namespace, pvr.OwnerReferences[0].Name)) | ||
| } | ||
|
|
||
| if !isPVRInFinalState(pvr) && pvr.Spec.UploaderType == uploader.ResticType { |
There was a problem hiding this comment.
Let's do this in SetupWithManager and replace IsLegacyPVR with ValidateUploaderType
|
|
||
| // Intentional: one Restic volume fails the whole pod restore (we do not partially restore Kopia volumes). | ||
| for _, info := range volumesToRestore { | ||
| if info.repositoryType == velerov1api.BackupRepositoryTypeRestic { |
There was a problem hiding this comment.
Let's call ValidateUploaderType to do this check instead
| // created with Restic, which Velero no longer supports for file-system backup. | ||
| // If any volume for the pod is Restic-backed, the entire pod volume restore is aborted (including | ||
| // volumes that used Kopia in the same backup set), so the message reflects whole-pod behavior. | ||
| var ErrResticFileSystemBackupUnsupported = errors.New("Restic file-system backup is no longer supported; when any volume for this pod is Restic-backed, the entire pod volume restore is skipped (including non-Restic volumes). Create a new backup with the Kopia uploader and restore from it") |
There was a problem hiding this comment.
This is not required if you call ValidateUploaderType
|
@testsabirweb Thanks for the contribution. Please resolve the conflicts and also address the comments. |
|
@testsabirweb |
Hi @blackpiglet , |
Thank you for contributing to Velero!
Please add a summary of your change
This PR removes Restic support from the Pod Volume Restore (PVR) path as part of the v1.19 Restic deprecation work (epic #9467).
Restorer (
pkg/podvolume)ErrResticFileSystemBackupUnsupportedand no PVRs are created for that pod. The error documents whole-pod behavior: when any volume is Restic-backed, the entire pod volume restore is skipped (including volumes that would otherwise use Kopia), so users are not told only “Restic volumes” failed.ResticIdentifierwiring for PVR creation (Kopia-only path).Advanced PVR controller
spec.uploaderTypeis explicitlyrestic, the PVR is failed early with the same error, before finalizers or data path setup.Legacy controller
IsLegacyPVRalways returnsfalse(the legacy async reconcile existed only for Restic). The legacy controller therefore no longer processes PVRs.Server and node-agent
IsLegacyPVRbranches and themarkLegacyPVRsFailedrecovery path on node-agent startup (those paths never ran afterIsLegacyPVRbecame always false).Tests
Does your change fix a particular issue?
Fixes #9468
Please indicate you've done the following:
make new-changelog) or comment/kind changelog-not-requiredon this PR.changelogs/unreleased/9662-testsabirweb.site/content/docs/main.site/content/docs/main; follow up there or in a separate PR if required by reviewers.