Skip to content

Commit

Permalink
e2e: replace quoted namespace in templates too
Browse files Browse the repository at this point in the history
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 <ndevos@ibm.com>
  • Loading branch information
nixpanic committed Mar 14, 2024
1 parent 32de268 commit b1a3334
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion e2e/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit b1a3334

Please sign in to comment.