From 286217c20d08ce4162fa543ffb7fa8b04d2f0b3f Mon Sep 17 00:00:00 2001 From: Helder Santana Date: Wed, 12 Jul 2023 11:15:56 +0200 Subject: [PATCH] Adjust helm to support deletion protection flags --- helm-charts | 2 +- test/e2e/cli/helm/helm.go | 8 ++++++++ test/int/project_protect_test.go | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/helm-charts b/helm-charts index 50bd0ec1a6..35843312f5 160000 --- a/helm-charts +++ b/helm-charts @@ -1 +1 @@ -Subproject commit 50bd0ec1a6a148a63cb98e3f4d7377d111a0f1c8 +Subproject commit 35843312f561b4413fb01424c674593270bcb942 diff --git a/test/e2e/cli/helm/helm.go b/test/e2e/cli/helm/helm.go index 9c98d78c92..8a1d4cb53a 100644 --- a/test/e2e/cli/helm/helm.go +++ b/test/e2e/cli/helm/helm.go @@ -107,6 +107,8 @@ func InstallOperatorWideSubmodule(input model.UserInputs) { "atlas-operator-"+input.Project.GetProjectName(), config.AtlasOperatorHelmChartPath, "--set-string", fmt.Sprintf("atlasURI=%s", config.AtlasHost), + "--set", "objectDeletionProtection=false", + "--set", "subobjectDeletionProtection=false", "--set-string", fmt.Sprintf("image.repository=%s", repo), "--set-string", fmt.Sprintf("image.tag=%s", tag), "--namespace", input.Namespace, @@ -122,6 +124,8 @@ func InstallOperatorNamespacedFromLatestRelease(input model.UserInputs) { "mongodb/mongodb-atlas-operator", "--set", fmt.Sprintf("watchNamespaces={%s}", input.Namespace), "--set-string", fmt.Sprintf("atlasURI=%s", config.AtlasHost), + "--set", "objectDeletionProtection=false", + "--set", "subobjectDeletionProtection=false", "--namespace="+input.Namespace, "--create-namespace", ) @@ -141,6 +145,8 @@ func InstallOperatorNamespacedSubmodule(input model.UserInputs) { "--set-string", fmt.Sprintf("image.tag=%s", tag), "--set", fmt.Sprintf("watchNamespaces={%s}", input.Namespace), "--set", "mongodb-atlas-operator-crds.enabled=false", + "--set", "objectDeletionProtection=false", + "--set", "subobjectDeletionProtection=false", "--namespace="+input.Namespace, "--create-namespace", ) @@ -188,6 +194,8 @@ func UpgradeOperatorChart(input model.UserInputs) { "atlas-operator-"+input.Project.GetProjectName(), config.AtlasOperatorHelmChartPath, "--set-string", fmt.Sprintf("atlasURI=%s", config.AtlasHost), + "--set", "objectDeletionProtection=false", + "--set", "subobjectDeletionProtection=false", "--set-string", fmt.Sprintf("image.repository=%s", repo), "--set-string", fmt.Sprintf("image.tag=%s", tag), "-n", input.Namespace, diff --git a/test/int/project_protect_test.go b/test/int/project_protect_test.go index d898a94b8a..a00355f093 100644 --- a/test/int/project_protect_test.go +++ b/test/int/project_protect_test.go @@ -56,7 +56,7 @@ var _ = Describe("AtlasProject", Label("int", "AtlasProject", "protection-enable }) // nolint:dupl - By("Deleting project in cluster don't delete from Atlas", func() { + By("Deleting project in cluster doesn't delete from Atlas", func() { projectID := testProject.ID() Expect(k8sClient.Delete(context.TODO(), testProject, &client.DeleteOptions{})).To(Succeed()) @@ -98,7 +98,7 @@ var _ = Describe("AtlasProject", Label("int", "AtlasProject", "protection-enable }) // nolint:dupl - By("Deleting project in cluster don't delete from Atlas", func() { + By("Deleting project in cluster doesn't delete from Atlas", func() { projectID := testProject.ID() Expect(k8sClient.Delete(context.TODO(), testProject, &client.DeleteOptions{})).To(Succeed())