From ff728eaf0d3d5ab7caeb6769e3667fa00258fa76 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 16 Feb 2021 13:28:34 +0100 Subject: [PATCH] e2e: error out in case deploying Hashicorp Vault fails Failures when deploying Hashicorp Vault are logged as informative. This means that testing will continue, even if Vault will not be available. Instead of logging the errors as INFO, use FAIL so that tests are not run and the problems are identified early and obviously. Updates: #1795 Signed-off-by: Niels de Vos --- e2e/deploy-vault.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/e2e/deploy-vault.go b/e2e/deploy-vault.go index dddb06ec4..7d7918f08 100644 --- a/e2e/deploy-vault.go +++ b/e2e/deploy-vault.go @@ -45,7 +45,7 @@ func deleteVault() { func createORDeleteVault(action string) { data, err := replaceNamespaceInTemplate(vaultExamplePath + vaultServicePath) if err != nil { - e2elog.Logf("failed to read content from %s %v", vaultExamplePath+vaultServicePath, err) + e2elog.Failf("failed to read content from %s %v", vaultExamplePath+vaultServicePath, err) } data = strings.ReplaceAll(data, "vault.default", "vault."+cephCSINamespace) @@ -53,34 +53,34 @@ func createORDeleteVault(action string) { data = strings.ReplaceAll(data, "value: default", "value: "+cephCSINamespace) _, err = framework.RunKubectlInput(cephCSINamespace, data, action, ns, "-f", "-") if err != nil { - e2elog.Logf("failed to %s vault statefulset %v", action, err) + e2elog.Failf("failed to %s vault statefulset %v", action, err) } data, err = replaceNamespaceInTemplate(vaultExamplePath + vaultRBACPath) if err != nil { - e2elog.Logf("failed to read content from %s %v", vaultExamplePath+vaultRBACPath, err) + e2elog.Failf("failed to read content from %s %v", vaultExamplePath+vaultRBACPath, err) } _, err = framework.RunKubectlInput(cephCSINamespace, data, action, ns, "-f", "-") if err != nil { - e2elog.Logf("failed to %s vault statefulset %v", action, err) + e2elog.Failf("failed to %s vault statefulset %v", action, err) } data, err = replaceNamespaceInTemplate(vaultExamplePath + vaultConfigPath) if err != nil { - e2elog.Logf("failed to read content from %s %v", vaultExamplePath+vaultConfigPath, err) + e2elog.Failf("failed to read content from %s %v", vaultExamplePath+vaultConfigPath, err) } data = strings.ReplaceAll(data, "default", cephCSINamespace) _, err = framework.RunKubectlInput(cephCSINamespace, data, action, ns, "-f", "-") if err != nil { - e2elog.Logf("failed to %s vault configmap %v", action, err) + e2elog.Failf("failed to %s vault configmap %v", action, err) } data, err = replaceNamespaceInTemplate(vaultExamplePath + vaultPSPPath) if err != nil { - e2elog.Logf("failed to read content from %s %v", vaultExamplePath+vaultPSPPath, err) + e2elog.Failf("failed to read content from %s %v", vaultExamplePath+vaultPSPPath, err) } _, err = framework.RunKubectlInput(cephCSINamespace, data, action, ns, "-f", "-") if err != nil { - e2elog.Logf("failed to %s vault psp %v", action, err) + e2elog.Failf("failed to %s vault psp %v", action, err) } }