title: Helm library chart returning can't evaluate field Values in type []interface {}
body: <p>I'm following the Helm Library chart example in the Helm docs <a href="https://helm.sh/docs/topics/library_charts/#create-a-simple-library-chart" rel="nofollow noreferrer">here</a>.</p>
  <p>The original example has a common ConfigMap in the library chart defined as follows:</p>
  <pre><code>apiVersion: v1
  kind: ConfigMap
  metadata:
    name: {{ .Release.Name | printf &quot;%s-%s&quot; .Chart.Name }}
  data: {}
  {{- end -}}
  {{- define &quot;mylibchart.configmap&quot; -}}
  {{- include &quot;mylibchart.util.merge&quot; (append . &quot;mylibchart.configmap.tpl&quot;) -}}
  {{- end -}}
  </code></pre>
  <p>I'm working on a chart that requires me to have an if statement to enable or disable a particular resource. In this  example, it's a configmap, but it could be an HPA or a deployment in a blue / green chart.</p>
  <p>When I add the If statement as follows:</p>
  <pre><code>apiVersion: v1
  kind: ConfigMap
  metadata:
    name: {{ .Release.Name | printf &quot;%s-%s&quot; .Chart.Name }}
  data: {}
  {{- end -}}
  {{- define &quot;mylibchart.configmap&quot; -}}
  {{- if .Values.configMapEnabled }}
  {{- include &quot;mylibchart.util.merge&quot; (append . &quot;mylibchart.configmap.tpl&quot;) -}}
  {{- end -}}
  {{- end -}}
  </code></pre>
  <p>where <code>.Values.configMapEnabled</code> exists in the values.yaml file, and is set to <code>true</code>.</p>
  <p>Everything else stays the same as described in the documentation i.e. I use a simple chart to include the library chart as a dependency, and I run:</p>
  <p><code>helm install mydemo mychart/ --debug --dry-run</code></p>
  <p>I am receiving the following error:</p>
  <pre><code>helm.go:84: [debug] template: mychart/templates/configmap.yaml:1:4: executing &quot;mychart/templates/configmap.yaml&quot; at &lt;include &quot;mylibchart.configmap&quot; (list . &quot;mychart.configmap&quot;)&gt;: error calling include: template: mychart/charts/mylibchart/templates/_configmap.yaml:9:14: executing &quot;mylibchart.configmap&quot; at &lt;.Values.configMapEnabled&gt;: can't evaluate field Values in type []interface {}
  </code></pre>
  <p>Why isn't the Values field not being evaluated? It seems like a scoping issue, but I'm not able to resolve it.</p>