From 680cc44010d120972f56afb634a8baba53cb9860 Mon Sep 17 00:00:00 2001 From: Radovan Zvoncek Date: Mon, 2 Dec 2024 11:34:57 +0200 Subject: [PATCH] Remove get before delete in medusabackupjob_controller_test --- .../medusa/medusabackupjob_controller_test.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/controllers/medusa/medusabackupjob_controller_test.go b/controllers/medusa/medusabackupjob_controller_test.go index c2100b6b5..bda09450c 100644 --- a/controllers/medusa/medusabackupjob_controller_test.go +++ b/controllers/medusa/medusabackupjob_controller_test.go @@ -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) } - } }