<p>I am trying to pull values out of a kubernetes helm chart values.yaml that has a number as one of the keys and I'm getting a <code>parse error unexpected ".1" in operand</code>. How can I access values that contain a number in its path? </p>

<p>Let's say my values.yaml looks like this:</p>

<pre><code>global:
  foo:
    bar1: 1
  1:
    bar2: 2
</code></pre>

<p>Using helm charts, I can access <code>bar1</code> by typing: <code>{{ .Values.global.foo.bar1 }}</code>. </p>

<p>If I try to do the same with accessing <code>bar2</code> by typing: <code>{{ .Values.global.1.bar2 }}</code> I receive a parse error. It doesn't get better if I try to use brackets <code>{{ .Values.global[1].bar2 }}</code>, quotes <code>{{ .Values.global."1".bar2 }}</code>, or brackets and quotes: <code>{{ .Values.global["1"].bar2 }}</code>. </p>

<p>I know that helm charts utilize golang templates under the hood, is there some kind of template I could create to extract this information?</p>

<p>Thanks so much!</p>

Coherent
<p>The easy option is to just quote it in your values file so it's a string but:</p>

<pre><code>{{ index .Values.globals 1 "bar2"}}
</code></pre>

<p>is probably what you want.</p>
