From b1a333471ad0cf69a82f9e67314536e8ad2cc5f1 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Thu, 14 Mar 2024 14:40:24 +0100 Subject: [PATCH] e2e: replace quoted namespace in templates too Some templates are now generated with the API, and these include namespaces as "quotes" values. Namespace replacing in the templates need to replace both the unquoted and quoted strings. Signed-off-by: Niels de Vos --- e2e/namespace.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/e2e/namespace.go b/e2e/namespace.go index 21eafd15e08..7321c37a180 100644 --- a/e2e/namespace.go +++ b/e2e/namespace.go @@ -94,5 +94,9 @@ func replaceNamespaceInTemplate(filePath string) (string, error) { return "", err } - return strings.ReplaceAll(string(read), "namespace: default", fmt.Sprintf("namespace: %s", cephCSINamespace)), nil + // template can contain "default" as namespace, with or without ". + templ := strings.ReplaceAll(string(read), "namespace: default", fmt.Sprintf("namespace: %s", cephCSINamespace)) + templ = strings.ReplaceAll(templ, "namespace: \"default\"", fmt.Sprintf("namespace: %s", cephCSINamespace)) + + return templ, nil }