-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Escaping template strings not working #3989
Comments
We've workarounded this by rearranging the manifest templates in a way that all variable substitutions come before the parts that need escaping, and adding a comment like ...
spec:
loggingRef: ${environment.namespace}-demo # TODO garden fails to expand this variable after the first escape, keeping this line before that
# hack: $${}
filters:
- parser:
metrics-probe:
key: "probe"
labels:
namespace: "${json#kubernetes#namespace_name}" # the manifests contain these exact label templates that use similar variable expansion syntax as garden
pod: "${json#kubernetes#pod_name}" |
@orymate thanks for sharing the workaround! |
@orymate we have fixed this in 0.13.39. Feel free to try it out! Please note, that the workaround cannot be used along with 0.13.39. |
Bug
Current Behavior
I need the literal value
${foo}
in a resulting k8s template of a garden kubernetes module.The garden docs describe how this should be done: Using
$${}
instead of${}
.However, it ends up literally like this after rendering:
I.e., no interpolation at all happened.
Garden doesn't eat the dollar. Maybe this only happens in the free tier 😆
Expected behavior
I expect this to be the result of the template rendering:
Additional idea
@worldofgeese pointed me to the docs, which I haven't found on my own.
I suggest moving the whole
Escaping template strings
paragraph fromModule Templates
toVariables and Templating
. My understanding is that theModule Templates
page only holds information in regards to thekind: Module; type: templated
modules. The interpolation escape mechanism however is a globally available feature, right?Your environment
garden version
v0.12.53
The text was updated successfully, but these errors were encountered: