Skip to content

Support for nested template in Datasource #1239

Answered by hairyhenderson
HenryXie1 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @HenryXie1, thanks for filing this - I've converted this to a discussion as this is more of a usage question than an issue. If there is indeed a bug or feature request that comes out of this, we can open an issue from it later!

That said, the syntax {{ (ds "vault:" {{ (ds "config").spec.vault.secretPrefix }}).data.client_id }} obviously doesn't work - this is because everything between the outer {{}} is in a template context already, and inner {{}} won't change that.

You can just reference the ds function instead:

{{ (ds "vault:" (ds "config").spec.vault.secretPrefix).data.client_id }}

Or, with a variable (which may be more readable anyway):

{{ $prefix := (ds "config").spec.vault.secre…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by HenryXie1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1238 on November 04, 2021 22:45.