<p>I am trying to access a file inside my helm templates as a config map, like below. I get an error as below. </p>

<p>However, it works when my application.yml doesn't have nested objects (Eg - name: test). Any ideas on what I could be doing wrong?</p>

<p><strong>config-map.yaml:</strong></p>

<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
 name: {{ .Release.Name }}-configmap

data:
 {{.Files.Get “application.yml”}}
</code></pre>

<p><strong>application.yml:</strong></p>

<pre><code>some-config:
 application:
   name: some-application-name
</code></pre>

<p><strong>ERROR:</strong></p>

<pre><code>*ConfigMap in version “v1" cannot be handled as a ConfigMap: v1.ConfigMap.Data: ReadString: expects ” or n, but found {, error found in #10 byte of ...|ication”* 

</code></pre>

zooes
<p>Looks like you have an indentation issue on your <code>application.yaml</code> file. Perhaps invalid YAML? If I try your very same files I get the following:</p>

<pre><code>○ → helm template ./mychart -x templates/configmap.yaml
---
# Source: mychart/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
 name: release-name-configmap
data:
  some-config:
 application:
   name: some-application-name
</code></pre>
