I want to use template inside template with "." operator in my helm chart.
Suppose this is my values.yaml
component: my-component
my-component-arguments:
heap_opts: "heap-opts"
Now I want to get "heap_opts", but component name is dynamic. How can I do something like this using template?
{{ .Values."{{.Values.component}}-arguments".heap_opts }}
You can do this using get spring function combined with index and printf from text/template package
{{ get (index .Values (printf "%s-arguments" .Values.component)) "heap_opts" }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With