Skip to content

How to escape expression in Vault Injector annotation #12805

Closed Answered by dbeilin
dbeilin asked this question in Q&A
Discussion options

You must be logged in to vote

Eventually, this worked:

{{= "{"+"{- with secret \"" + fromJSON(inputs.parameters.run_params).vault_ci_path + "\" }"+"}" }

At the end of the line I concatenated two curly brackets because }} didn't work for some reason (also tried -}}). Now it works without escaping the rest of the lines.

Honestly this seems way to complicated, I might just pass this as a parameter and set the value in the template.
Also, thanks for the tip about not having to use sprig, fromJSON works as well :)
Also also, thanks for the explanation about the templating engines at work here.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@Joibel
Comment options

@agilgur5
Comment options

@dbeilin
Comment options

@Joibel
Comment options

@dbeilin
Comment options

Comment options

You must be logged in to vote
1 reply
@agilgur5
Comment options

Answer selected by dbeilin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
solution/workaround There's a workaround, might not be great, but exists area/templating Templating with `{{...}}`
3 participants