From de6c0c573c3f2f32fbd420166c2effd588513efd Mon Sep 17 00:00:00 2001 From: Anish Ramasekar Date: Wed, 14 Dec 2022 20:07:05 -0800 Subject: [PATCH] test: update helm install logic for upgrade tests (#1041) Signed-off-by: Anish Ramasekar --- .pipelines/templates/e2e-test.yaml | 8 +++----- test/e2e/e2e_suite_test.go | 1 - test/e2e/framework/helm/helm.go | 12 ++++++++++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.pipelines/templates/e2e-test.yaml b/.pipelines/templates/e2e-test.yaml index 4bca3b309..5a642975f 100644 --- a/.pipelines/templates/e2e-test.yaml +++ b/.pipelines/templates/e2e-test.yaml @@ -3,7 +3,7 @@ parameters: type: string - name: testReleasedVersion type: boolean - default: false + default: false - name: resetImageVersion type: boolean default: false @@ -47,9 +47,7 @@ steps: export REGISTRY="${REGISTRY:-$(REGISTRY_NAME).azurecr.io/k8s/csi/secrets-store}" fi if [ "${{ parameters.testReleasedVersion }}" == True ] ; then - export HELM_CHART_DIR=charts/csi-secrets-store-provider-azure - else - export HELM_CHART_DIR=manifest_staging/charts/csi-secrets-store-provider-azure + export HELM_CHART_DIR=https://azure.github.io/secrets-store-csi-driver-provider-azure/charts fi make e2e-test displayName: "${{ parameters.testName }}" @@ -72,7 +70,7 @@ steps: CI_KIND_CLUSTER: ${{ parameters.ciKindCluster }} ${{ if parameters.isArcTest }}: IS_ARC_TEST: ${{ parameters.isArcTest }} - # If the image is a released versions (i.e <= v1.3), it still doesn't support the + # If the image is a released versions (i.e <= v1.3), it still doesn't support the # split cert/key feature, so we need to skip tests for those versions. ${{ if parameters.testReleasedVersion }}: GINKGO_SKIP: WriteCertAndKeyInSeparateFiles diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index 8d864a5ec..7eda16a8b 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -103,7 +103,6 @@ var _ = BeforeSuite(func() { }) var _ = AfterSuite(func() { - // cleanup defer func() { // uninstall if it's not Soak Test, not backward compatibility test and if cluster is already upgraded or it's not cluster upgrade test if !config.IsSoakTest && !config.IsArcTest && !config.IsBackwardCompatibilityTest && (!config.IsUpgradeTest || config.IsClusterUpgraded) { diff --git a/test/e2e/framework/helm/helm.go b/test/e2e/framework/helm/helm.go index 8d120b17c..75c7bfa8a 100644 --- a/test/e2e/framework/helm/helm.go +++ b/test/e2e/framework/helm/helm.go @@ -20,6 +20,7 @@ const ( // see https://github.com/Azure/secrets-store-csi-driver-provider-azure/issues/596 chartName = "csi-secrets-store-provider-azure" podIdentityChartName = "pi" + providerChartsRepo = "https://azure.github.io/secrets-store-csi-driver-provider-azure/charts" ) // InstallInput is the input for Install. @@ -41,6 +42,17 @@ func Install(input InstallInput) { defer os.Chdir(cwd) chartDir := input.Config.HelmChartDir + // if chartDir is the official helm repo, then add the repo and update so the latest package is used + if chartDir == providerChartsRepo { + args := append([]string{"repo", "add", "csi-secrets-store-provider-azure", providerChartsRepo}) + err := helm(args) + Expect(err).To(BeNil()) + + args = append([]string{"repo", "update"}) + err = helm(args) + Expect(err).To(BeNil()) + chartDir = "csi-secrets-store-provider-azure/csi-secrets-store-provider-azure" + } args := append([]string{ "install",