From 91228522be10b742793166f2bfac48e4c9aa6185 Mon Sep 17 00:00:00 2001 From: Steve Kriss Date: Thu, 2 Apr 2020 12:57:38 -0600 Subject: [PATCH] bug fix: save PVBs even if no snapshot was taken Signed-off-by: Steve Kriss --- pkg/restic/backupper.go | 3 --- pkg/restore/restore.go | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/restic/backupper.go b/pkg/restic/backupper.go index 25adb50d3..589b33cf3 100644 --- a/pkg/restic/backupper.go +++ b/pkg/restic/backupper.go @@ -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)) diff --git a/pkg/restore/restore.go b/pkg/restore/restore.go index 6890c9924..5584a75e5 100644 --- a/pkg/restore/restore.go +++ b/pkg/restore/restore.go @@ -1025,7 +1025,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