-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Remove Restic path for Pod Volume Restore #9662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Issue #9468: Remove Restic path for Pod Volume Restore; Restic file-system restores are no longer supported |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -359,6 +359,8 @@ func (c *PodVolumeRestoreReconcilerLegacy) closeDataPath(ctx context.Context, pv | |
| c.dataPathMgr.RemoveAsyncBR(pvbName) | ||
| } | ||
|
|
||
| func IsLegacyPVR(pvr *velerov1api.PodVolumeRestore) bool { | ||
| return pvr.Spec.UploaderType == uploader.ResticType | ||
| // IsLegacyPVR reports whether the PodVolumeRestore uses the legacy async reconcile path. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This pod_volume_restore_controller_legacy.go file could be fully removed. |
||
| // That path existed only for Restic; Restic file-system restore is no longer supported, so this always returns false. | ||
| func IsLegacyPVR(_ *velerov1api.PodVolumeRestore) bool { | ||
| return false | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,6 +128,13 @@ func (r *restorer) RestorePodVolumes(data RestoreData, tracker *volume.RestoreVo | |
| return nil | ||
| } | ||
|
|
||
| // 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 { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's call |
||
| return []error{ErrResticFileSystemBackupUnsupported} | ||
| } | ||
| } | ||
|
|
||
| if err := nodeagent.IsRunningOnLinux(r.ctx, r.kubeClient, data.Restore.Namespace); err != nil { | ||
| return []error{errors.Wrapf(err, "error to check node agent status")} | ||
| } | ||
|
|
@@ -166,11 +173,6 @@ func (r *restorer) RestorePodVolumes(data RestoreData, tracker *volume.RestoreVo | |
| podVolumes[podVolume.Name] = podVolume | ||
| } | ||
|
|
||
| repoIdentifier := "" | ||
| if repositoryType == velerov1api.BackupRepositoryTypeRestic { | ||
| repoIdentifier = repo.Spec.ResticIdentifier | ||
| } | ||
|
|
||
| for volume, backupInfo := range volumesToRestore { | ||
| volumeObj, ok := podVolumes[volume] | ||
| var pvc *corev1api.PersistentVolumeClaim | ||
|
|
@@ -185,7 +187,7 @@ func (r *restorer) RestorePodVolumes(data RestoreData, tracker *volume.RestoreVo | |
| } | ||
| } | ||
|
|
||
| volumeRestore := newPodVolumeRestore(data.Restore, data.Pod, data.BackupLocation, volume, backupInfo.snapshotID, backupInfo.snapshotSize, repoIdentifier, backupInfo.uploaderType, data.SourceNamespace, pvc) | ||
| volumeRestore := newPodVolumeRestore(data.Restore, data.Pod, data.BackupLocation, volume, backupInfo.snapshotID, backupInfo.snapshotSize, "", backupInfo.uploaderType, data.SourceNamespace, pvc) | ||
| if err := veleroclient.CreateRetryGenerateName(r.crClient, r.ctx, volumeRestore); err != nil { | ||
| errs = append(errs, errors.WithStack(err)) | ||
| continue | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ | |
| package podvolume | ||
|
|
||
| import ( | ||
| "errors" | ||
| "fmt" | ||
| "strings" | ||
|
|
||
|
|
@@ -36,6 +37,12 @@ | |
| podAnnotationPrefix = "snapshot.velero.io/" | ||
| ) | ||
|
|
||
| // ErrResticFileSystemBackupUnsupported is returned when a restore targets PodVolumeBackups | ||
| // 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") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not required if you call |
||
|
|
||
| // volumeBackupInfo describes the backup info of a volume backed up by PodVolumeBackups | ||
| type volumeBackupInfo struct { | ||
| snapshotID string | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do this in
SetupWithManagerand replaceIsLegacyPVRwithValidateUploaderType