I am setting the following environment variable in Helm Deployment like so.
name: SERVER_ENDPOINT
value: {{ .Values.server.dev_proxy_endpoint }}
But would like to interpolate the environment part (dev) of the value variable, like so
name: SERVER_ENDPOINT
value: {{ .Values.server. {{ .Values.environment | lower }} _proxy_endpoint }}
Is this possible?
Reply to first comment
I tried that out by creating a new definition at the top of the file like so:
{{- $value_path_to_endpoint := print ".Values.server." .Values.environment "_proxy_endpoint" -}}
But that then presents a literal value, rather than the context pointer to the values file.
name: SERVER_ENDPOINT
value: {{ $value_path_to_endpoint}}
In other words, $value_path_to_endpoint returns:
".Values.server.dev_proxy_endpoint"
Rather than
.Values.server.dev_proxy_endpoint