Skip to content

Commit

Permalink
OADP-1002: Ignore not found err for temp vsclass in cases of data mov…
Browse files Browse the repository at this point in the history
…er without PVC (#215)
  • Loading branch information
eemcmullan authored and sseago committed Feb 8, 2023
1 parent b35776f commit 23d4bcd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/datamover/datamover.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 23d4bcd

Please sign in to comment.