title: Using a variable in helm include (or template) for the name
body: <p>I made a design for my helm chart which uses templates to set certain parts of my kubernetes deployment. The templates are per cloud provider:</p>
  
  <p>A template for GCE, a template for AWS, etc.</p>
  
  <p>The template is then included into the deployment part of the chart in Helm.</p>
  
  <p>Now there is a pretty way of doing this which is:
  Name every template according to the cloud provider it is intended for, and use a variable in the values.yaml to direct this.</p>
  
  <p>And there is a less pretty way with a bunch of if statements.</p>
  
  <p>I want to use the pretty way since it requires a lot less maintenance and code downstream, but can not get the following to work:</p>
  
  <pre><code>{{- include {{.Values.resources.cloudProvider}} .}}
  </code></pre>
  
  <p>In this statement the <code>{{.Values.resources.cloudProvider}}</code> contains my cloud provider name (aws, gce, etc)</p>
  
  <p>The error I get is:</p>
  
  <pre><code>Error: parse error in "testModel/templates/deployment.yaml": 
  template: testModel/templates/deployment.yaml:28: 
  unexpected "{" in operand
  </code></pre>
  
  <p>The other method I tested is:</p>
  
  <pre><code>{{- include (.Values.resources.cloudProvider) .}}
  </code></pre>
  
  <p>Which gives:</p>
  
  <pre><code>Error: render error in "testModel/templates/deployment.yaml": template:
  testModel/templates/deployment.yaml:29:23: 
  executing "testModel/templates/deployment.yaml" 
  at &lt;.Values.resources.c...&gt;: invalid value; expected string
  </code></pre>
  
  <p>Is there a way to use a variable for a template name when including the template?</p>