Skip to content
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

[oadp-1.1] OADP-1002: Ignore not found err for temp vsclass in cases of data mover without PVC #217

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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