diff --git a/pkg/datamover/datamover.go b/pkg/datamover/datamover.go index 89c71d0388..e7d2b722a3 100644 --- a/pkg/datamover/datamover.go +++ b/pkg/datamover/datamover.go @@ -14,6 +14,7 @@ import ( "github.com/pkg/errors" velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1" "golang.org/x/sync/errgroup" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" kbclient "sigs.k8s.io/controller-runtime/pkg/client" @@ -137,6 +138,12 @@ func DeleteTempVSClass(backupName string, tempVS snapshotv1listers.VolumeSnapsho tempVSClassName := fmt.Sprintf("%s-snapclass", backupName) tempVSClass, err := tempVS.Get(tempVSClassName) if err != nil { + // ignore is not found err as it is possible to create data mover + // backup without an existing PVC + // in which case this VSClass will not exist + if apierrors.IsNotFound(err) { + return nil + } log.Errorf("failed to get temp vsClass %v", tempVSClassName) return err }