Search code examples
kuberneteskubernetes-helm

Extracting value dynamically from dictionary on helm2


I'm trying to run a bit of a complicated helm chart, and need some help.

I'm trying to get value from a dictionary like that:

get .myDictionary .Values.dictionaryKey

Unfortunately, looks like get function is not supported in helm 2 which I'm using. Do you have any advice on how to get the dictionary value with dynamic value coming from a variable on helm2?


Solution

  • The core Go text/template language contains a index function that does what you're looking for.

    {{ index .myDictionary .Values.dictionaryKey }}