diff --git a/changelogs/unreleased/7762-kaovilai b/changelogs/unreleased/7762-kaovilai new file mode 100644 index 0000000000..6c515123dc --- /dev/null +++ b/changelogs/unreleased/7762-kaovilai @@ -0,0 +1 @@ +Surface errors when waiting for backupRepository and timeout occurs diff --git a/pkg/repository/ensurer.go b/pkg/repository/ensurer.go index 96feeb8fa4..071d2b4e25 100644 --- a/pkg/repository/ensurer.go +++ b/pkg/repository/ensurer.go @@ -122,8 +122,6 @@ func (r *Ensurer) waitBackupRepository(ctx context.Context, namespace string, ba if err == nil { repo = found return true, nil - } else if isBackupRepositoryNotFoundError(err) || isBackupRepositoryNotProvisionedError(err) { - return false, nil } else { return false, err } diff --git a/pkg/repository/ensurer_test.go b/pkg/repository/ensurer_test.go index a5128c9b44..d7f67094f4 100644 --- a/pkg/repository/ensurer_test.go +++ b/pkg/repository/ensurer_test.go @@ -102,7 +102,7 @@ func TestEnsureRepo(t *testing.T) { bkRepoObjNotReady, }, runtimeScheme: scheme, - err: "failed to wait BackupRepository: context deadline exceeded", + err: "failed to wait BackupRepository: backup repository not provisioned", }, { name: "create fail", @@ -110,7 +110,7 @@ func TestEnsureRepo(t *testing.T) { bsl: "fake-bsl", repositoryType: "fake-repo-type", runtimeScheme: scheme, - err: "failed to wait BackupRepository: context deadline exceeded", + err: "failed to wait BackupRepository: backup repository not provisioned", }, } @@ -183,7 +183,7 @@ func TestCreateBackupRepositoryAndWait(t *testing.T) { bsl: "fake-bsl", repositoryType: "fake-repo-type", runtimeScheme: scheme, - err: "failed to wait BackupRepository: context deadline exceeded", + err: "failed to wait BackupRepository: backup repository not provisioned", }, }