Support for nested template in Datasource #1239
-
We are using vault as datasource on gomplate It is working with hardcode
config yaml is
Not sure how we can contruct wonder if it is supported or any workaround? Thanks heaps |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Add a variable but it does not work either |
Beta Was this translation helpful? Give feedback.
-
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 You can just reference the Or, with a variable (which may be more readable anyway): To make things slightly more readable, and assuming the you'd call $ gomplate -c config=path/to/config.yaml -f mytemplate.tmpl (see the docs for more details) Hope this helps - please mark this as answered if it solves your issue. |
Beta Was this translation helpful? Give feedback.
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:Or, with a variable (which may be more readable anyway):