Skip to content

Commit 6433288

Browse files
committed
Handle other errors for UUID lookup
Signed-off-by: Joseph <jvaikath@redhat.com>
1 parent bde9bf3 commit 6433288

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

cmd/shared/nabsl_requests.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"context"
2121
"fmt"
2222

23+
"k8s.io/apimachinery/pkg/api/errors"
2324
kbclient "sigs.k8s.io/controller-runtime/pkg/client"
2425

2526
nacv1alpha1 "github.com/migtools/oadp-non-admin/api/v1alpha1"
@@ -41,9 +42,11 @@ func FindNABSLRequestByNameOrUUID(ctx context.Context, client kbclient.WithWatch
4142
}, &testRequest)
4243
if err == nil {
4344
return nameOrUUID, nil
45+
} else if errors.IsNotFound(err) {
46+
return "", fmt.Errorf("request for NABSL %q not found", nameOrUUID)
4447
}
4548

46-
// Match NABSL name to UUID
49+
// Fallback:Match NABSL name to UUID
4750
var requestList nacv1alpha1.NonAdminBackupStorageLocationRequestList
4851
err = client.List(ctx, &requestList, kbclient.InNamespace(adminNamespace))
4952
if err != nil {

0 commit comments

Comments
 (0)