mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-08 14:21:18 +00:00
Merge pull request #2390 from skriss/fix-2366
bug fix: save PVBs even if no snapshot was taken
This commit is contained in:
1
changelogs/unreleased/2390-skriss
Normal file
1
changelogs/unreleased/2390-skriss
Normal file
@@ -0,0 +1 @@
|
||||
bug fix: save PodVolumeBackup manifests to object storage even if the volume was empty, so that on restore, the PV is dynamically reprovisioned if applicable
|
||||
@@ -174,9 +174,6 @@ ForEachVolume:
|
||||
case res := <-resultsChan:
|
||||
switch res.Status.Phase {
|
||||
case velerov1api.PodVolumeBackupPhaseCompleted:
|
||||
if res.Status.SnapshotID == "" { // when the volume is empty there is no restic snapshot, so best to exclude it
|
||||
break
|
||||
}
|
||||
podVolumeBackups = append(podVolumeBackups, res)
|
||||
case velerov1api.PodVolumeBackupPhaseFailed:
|
||||
errs = append(errs, errors.Errorf("pod volume backup failed: %s", res.Status.Message))
|
||||
|
||||
@@ -1034,7 +1034,7 @@ func (ctx *context) restoreItem(obj *unstructured.Unstructured, groupResource sc
|
||||
}
|
||||
|
||||
if pvc.Spec.VolumeName != "" && ctx.pvsToProvision.Has(pvc.Spec.VolumeName) {
|
||||
ctx.log.Infof("Resetting PersistentVolumeClaim %s/%s for dynamic provisioning because its PV %v has a reclaim policy of Delete", namespace, name, pvc.Spec.VolumeName)
|
||||
ctx.log.Infof("Resetting PersistentVolumeClaim %s/%s for dynamic provisioning", namespace, name)
|
||||
|
||||
// use the unstructured helpers here since we're only deleting and
|
||||
// the unstructured converter will add back (empty) fields for metadata
|
||||
|
||||
Reference in New Issue
Block a user