Skip to content

Commit

Permalink
Remove get before delete in medusabackupjob_controller_test
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvoncek committed Dec 2, 2024
1 parent d9b53f5 commit 680cc44
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions controllers/medusa/medusabackupjob_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,18 +535,10 @@ func deleteDatacenterPods(t *testing.T, f *framework.Framework, ctx context.Cont
pod := &corev1.Pod{}
podName := fmt.Sprintf("%s-%s-%d", dc.Spec.ClusterName, dc.DatacenterName(), i)
podKey := framework.NewClusterKey(dcKey.K8sContext, dcKey.Namespace, podName)
err := f.Get(ctx, podKey, pod)
err := f.Delete(ctx, podKey, pod)
if err != nil {
if !errors.IsNotFound(err) {
t.Logf("failed to get pod %s: %v", podKey, err)
}
} else {
err = f.Delete(ctx, podKey, pod)
if err != nil {
t.Logf("failed to delete pod %s: %v", podKey, err)
}
t.Logf("failed to delete pod %s: %v", podKey, err)
}

}
}

Expand Down

0 comments on commit 680cc44

Please sign in to comment.