From 1d49b6a2881bca1270b0fc7fd4beeeb3600b2825 Mon Sep 17 00:00:00 2001 From: Rakshith R Date: Thu, 5 Aug 2021 17:28:48 +0530 Subject: [PATCH] e2e: create reusable variable vaultUserSecretPath = "user-secret.yaml" Signed-off-by: Rakshith R --- e2e/deploy-vault.go | 1 + e2e/rbd.go | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/e2e/deploy-vault.go b/e2e/deploy-vault.go index 88283323a..c69c66da3 100644 --- a/e2e/deploy-vault.go +++ b/e2e/deploy-vault.go @@ -19,6 +19,7 @@ var ( vaultConfigPath = "kms-config.yaml" vaultTenantPath = "tenant-sa.yaml" vaultTenantAdminPath = "tenant-sa-admin.yaml" + vaultUserSecret = "user-secret.yaml" ) func deployVault(c kubernetes.Interface, deployTimeout int) { diff --git a/e2e/rbd.go b/e2e/rbd.go index 75709e32a..2834eaa19 100644 --- a/e2e/rbd.go +++ b/e2e/rbd.go @@ -815,7 +815,7 @@ var _ = Describe("RBD", func() { namespace := cephCSINamespace // create user Secret - err = retryKubectlFile(namespace, kubectlCreate, vaultExamplePath+"user-secret.yaml", deployTimeout) + err = retryKubectlFile(namespace, kubectlCreate, vaultExamplePath+vaultUserSecret, deployTimeout) if err != nil { e2elog.Failf("failed to create user Secret: %v", err) } @@ -830,7 +830,7 @@ var _ = Describe("RBD", func() { // delete user secret err = retryKubectlFile(namespace, kubectlDelete, - vaultExamplePath+"user-secret.yaml", + vaultExamplePath+vaultUserSecret, deployTimeout, "--ignore-not-found=true") if err != nil { @@ -867,7 +867,7 @@ var _ = Describe("RBD", func() { namespace := f.UniqueName // create user Secret - err = retryKubectlFile(namespace, kubectlCreate, vaultExamplePath+"user-secret.yaml", deployTimeout) + err = retryKubectlFile(namespace, kubectlCreate, vaultExamplePath+vaultUserSecret, deployTimeout) if err != nil { e2elog.Failf("failed to create user Secret: %v", err) } @@ -883,7 +883,7 @@ var _ = Describe("RBD", func() { err = retryKubectlFile( namespace, kubectlDelete, - vaultExamplePath+"user-secret.yaml", + vaultExamplePath+vaultUserSecret, deployTimeout, "--ignore-not-found=true") if err != nil { @@ -2402,7 +2402,7 @@ var _ = Describe("RBD", func() { namespace := f.UniqueName // create user Secret - err = retryKubectlFile(namespace, kubectlCreate, vaultExamplePath+"user-secret.yaml", deployTimeout) + err = retryKubectlFile(namespace, kubectlCreate, vaultExamplePath+vaultUserSecret, deployTimeout) if err != nil { e2elog.Failf("failed to create user Secret: %v", err) } @@ -2419,10 +2419,9 @@ var _ = Describe("RBD", func() { validateRBDImageCount(f, 0, defaultRBDPool) // delete user secret - err = retryKubectlFile( - namespace, + err = retryKubectlFile(namespace, kubectlDelete, - vaultExamplePath+"user-secret.yaml", + vaultExamplePath+vaultUserSecret, deployTimeout, "--ignore-not-found=true") if err != nil {