From b791872efc9a57238462bcea5f0f901eb0aaf6ce Mon Sep 17 00:00:00 2001 From: Loic Devulder Date: Tue, 26 Sep 2023 18:27:25 +0200 Subject: [PATCH] ci: add workaround for issue #515 Signed-off-by: Loic Devulder --- tests/e2e/uninstall-operator_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/e2e/uninstall-operator_test.go b/tests/e2e/uninstall-operator_test.go index a13ebf990..e12ef8ca3 100644 --- a/tests/e2e/uninstall-operator_test.go +++ b/tests/e2e/uninstall-operator_test.go @@ -85,6 +85,20 @@ var _ = Describe("E2E - Uninstall Elemental Operator", Label("uninstall-operator }, tools.SetTimeout(3*time.Minute), 5*time.Second).Should(ContainSubstring("NotFound")) }) + By("WORKAROUND: Removing finalizers from MachineInventory", func() { + machineList, err := kubectl.Run("get", "MachineInventory", + "--namespace", clusterNS, "-o", "jsonpath={.items[*].metadata.name}") + Expect(err).To(Not(HaveOccurred())) + + // Removing finalizers from MachineInventory + for _, machine := range strings.Fields(machineList) { + _, err := kubectl.Run("patch", "MachineInventory", + "--namespace", clusterNS, machine, "--type", "merge", + "--patch", "'{\"metadata\":{\"finalizers\":null}}'") + Expect(err).To(Not(HaveOccurred())) + } + }) + By("Deleting cluster resource", func() { Eventually(func() error { _, err := kubectl.Run("delete", "cluster",