How do I access an array item (e.g. a[2]) in templates?
Whenever I do this I get "bad character U+005B '['"
{{ .a[2] }}
How do I access an array item (e.g. a[2]) in templates?
Whenever I do this I get "bad character U+005B '['"
{{ .a[2] }}
to access a field on an array item as go templating in *.yaml format :
{{ (index .Values.fields 0).fieldItem }}
Index of zero(0) as in fields array of field as fieldItem .
You need to use the index
template function.
{{index .a 2}}
.$field
doesn't work –
Wolfenbarger {{ index (index .a 2) $field }}
–
Pteridology to access a field on an array item as go templating in *.yaml format :
{{ (index .Values.fields 0).fieldItem }}
Index of zero(0) as in fields array of field as fieldItem .
© 2022 - 2024 — McMap. All rights reserved.
{{ (index .a 2).field }}
. – Kassala