title: Helm template variables are nil
body: <p>I'm trying to use a template to pull values from values.yaml, concatenate them into a CSV list. Here's an example of my solution. </p>
  
  <p>values.yaml: </p>
  
  <pre><code>testValue1: "string1"
  testValue2: "String2"
  credentials: 
  - c1: "string3"
  - c2: "string4"
  </code></pre>
  
  <p>_helpers.tpl:</p>
  
  <pre><code>{{- define "test.template" -}}
  {{- $value1 := .Values.testValue1 -}}
  {{- $value2 := .Values.testValue2 -}}
  {{- $credentials := "" -}}
  {{- range $index, $cred := .Values.credentials -}}
  {{- $credentials = $cred "," $credentials -}}
  {{- end -}}
  {{- printf "%s,%s,%s" $value1 $value2 $credentials -}}
  {{- end -}}
  </code></pre>
  
  <p>test.yaml</p>
  
  <pre><code>templatedValue: {{ template "test.template" }}
  </code></pre>
  
  <p>When I run <code>helm template --output-dir outputs chart</code> I get: </p>
  
  <p>test.yaml</p>
  
  <pre><code>templatedValue: %!s(&lt;nil&gt;),%!s(&lt;nil&gt;),
  </code></pre>
  
  <p>both the variables I set as values are nil, and the <code>credentials</code> are just an empty string. If I put the values in the values.yaml directly into the <code>test.yaml</code> file it works fine. So I'm not sure why I'm getting these nil values from the template. There's other templates in the <code>_helpers.tpl</code> which grab values from the values.yaml file, so I'm not sure why my template doesn't work. Any help is greatly appreciated.</p>
  
  <pre><code>helm version: 
  Client: &amp;version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}
  Server: &amp;version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}
  </code></pre>