confd icon indicating copy to clipboard operation
confd copied to clipboard

getv unable to expand variable in argument

Open ecsumed opened this issue 4 years ago • 1 comments

I've looked around and found no examples of this so not sure if this supported or not, but here's my example:

{{ $keys := gets "/prod/*/*/*" -}}

{{ range $keys -}}

{{ $info := split .Key "/" -}}

{{ $user := index $info 2 -}}

{{ getv "/prod/$user/002/config" }} # <------- This fails.

{{ end -}}

This fails with a getv: key does not exist: /prod/$user/002/config. I know for a fact that the key exists. To me it seems like $user is not being expanded.

So my question is: do arguments to getv support variable expansion?

Version:

# confd --version
confd 0.16.0 (Git SHA: 7217b0ca, Go Version: go1.10.2)

ecsumed avatar Nov 21 '20 19:11 ecsumed

Any news on this or how to use variable within ?

slejnej avatar Dec 04 '21 13:12 slejnej