I have set a yml file as confd backend. I have a yaml list to process something as below.
otherargs:
- "-Xmx256m"
- "-Xmn128m"
and trying to read the value from the list below. As this is a list I am using getvs to get all values in string[] and join those with ',' . Referring join.
values : [ {{$args := getvs "/otherargs"}}
{{join $args ","}}]
Output I received is as below
values : []
Here I am not getting the values from the yaml list via getvs .
As it is a list, the data should be collected via getvs but why I am receiving empty string I am not even getting single value here. so Does getvs work with yaml list? If yest then what am I missing here?
I also tried range functionality to get values received via getvs as below referring getvs
values : [{{range getvs "/otherargs"}}
{{.}},
{{end}}]
but received same empty array as result. :(
any help would be appreciated ?
I found the solution from here I was trying to use
getvsbut the solution to this issue waslscommand. Now I am able to populate this list from yml with below code.so final result, I received as below