Skip to content

Commit fd03bd7

Browse files
committed
Replace t.context() with context.TODO() for older go versions
Signed-off-by: Priyansh Choudhary <im1706@gmail.com>
1 parent 2d73c4b commit fd03bd7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/controller/backup_deletion_controller_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ func TestBackupDeletionControllerReconcile(t *testing.T) {
671671
td.backupStore.On("GetBackupVolumeSnapshots", input.Spec.BackupName).Return(snapshots, nil)
672672
td.backupStore.On("GetBackupContents", input.Spec.BackupName).Return(nil, fmt.Errorf("error downloading tarball"))
673673

674-
_, err := td.controller.Reconcile(t.Context(), td.req)
674+
_, err := td.controller.Reconcile(context.TODO(), td.req)
675675
require.NoError(t, err)
676676

677677
td.backupStore.AssertCalled(t, "GetBackupContents", input.Spec.BackupName)
@@ -688,7 +688,7 @@ func TestBackupDeletionControllerReconcile(t *testing.T) {
688688
assert.Contains(t, res.Status.Errors[0], "error downloading backup tarball, CSI snapshot cleanup was skipped")
689689

690690
// backup CR should NOT be deleted
691-
err = td.fakeClient.Get(t.Context(), types.NamespacedName{
691+
err = td.fakeClient.Get(context.TODO(), types.NamespacedName{
692692
Namespace: velerov1api.DefaultNamespace,
693693
Name: backup.Name,
694694
}, &velerov1api.Backup{})
@@ -767,7 +767,7 @@ func TestBackupDeletionControllerReconcile(t *testing.T) {
767767
assert.True(t, apierrors.IsNotFound(err), "Expected DBR to be deleted after not-found tarball error, but actual error: %v", err)
768768

769769
// backup CR should be deleted because there are no errors in errs
770-
err = td.fakeClient.Get(t.Context(), types.NamespacedName{
770+
err = td.fakeClient.Get(context.TODO(), types.NamespacedName{
771771
Namespace: velerov1api.DefaultNamespace,
772772
Name: backup.Name,
773773
}, &velerov1api.Backup{})

0 commit comments

Comments
 (0)