From f60426c07faa7bd37bbff1bc8794eae21c276cf5 Mon Sep 17 00:00:00 2001 From: Danail Branekov Date: Tue, 23 Apr 2024 09:20:12 +0000 Subject: [PATCH] Avoid data pollution on tear-down We are deleting the test org in background. By deleting a copy of the org we ensure that the shared `testOrg` variable is not modified once deletion is done. Not doing that would mess up subsequent `It`s Co-authored-by: Georgi Sabev --- tests/crds/crds_suite_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/crds/crds_suite_test.go b/tests/crds/crds_suite_test.go index f9dfb5712..d7027877f 100644 --- a/tests/crds/crds_suite_test.go +++ b/tests/crds/crds_suite_test.go @@ -162,7 +162,7 @@ var _ = BeforeEach(func() { }) var _ = AfterEach(func() { - Expect(k8sClient.Delete(ctx, testOrg, &client.DeleteOptions{ + Expect(k8sClient.Delete(ctx, testOrg.DeepCopy(), &client.DeleteOptions{ PropagationPolicy: tools.PtrTo(metav1.DeletePropagationBackground), })).To(Succeed()) })