Accessing values of Maps nested in an array #1722
Closed
Kalimero66
started this conversation in
General
Replies: 2 comments 1 reply
-
Anybody ? |
Beta Was this translation helpful? Give feedback.
0 replies
-
well ... no feedback ... closing this topic. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bonjour,
I'm stuck with a simple problem when trying to use gomplate on Helmfile input and I was wondering if someone can help.
My datasource file is a typical Helmfile input as follow:
Is it possible to access
k4
value (.iev4
) in one line ?I know I could potentially could just convert
values
into a map of maps instead but there must be a better way withgomplate
that I'm just not seeing.Here are my files if anyone interested.
.gomplate.yaml:
ds.yaml:
values
is an array of Maps , I guess I need to first find the index ofmyMap2
invalues
before accessingk4
.As I have many (30+) Maps under
values
, I use a nested template to find the index of the map in the array but I find it overkilled (and I haven't to cover any corner case yet). Like I said there must be a better way.in.yaml.gotmpl:
Beta Was this translation helpful? Give feedback.
All reactions