title: Helm3 - Reading json file into configmap produces a string?
body: <p><strong>Problem:</strong></p>
  
  <p>I want to read a json file into a configmap so it looks like:</p>
  
  <pre><code>apiVersion: v1
  kind: ConfigMap
  metadata:
    name: json-test
  data:
    test.json: |-
      {
        "key": "val"
      }
  </code></pre>
  
  <p>Instead I get</p>
  
  <pre><code>apiVersion: v1
  kind: ConfigMap
  metadata:
    name: json-test
  data:
    test.json: |-
        "{\r\n    \"key\": \"val\"\r\n}"
  </code></pre>
  
  <p><strong>What I've done:</strong></p>
  
  <p>I have the following helm chart:</p>
  
  <pre><code>Mode                 LastWriteTime         Length Name
  ----                 -------------         ------ ----
  d-----        2020-02-06  10:51 AM                static
  d-----        2020-02-06  10:55 AM                templates
  -a----        2020-02-06  10:51 AM             88 Chart.yaml
  </code></pre>
  
  <p>static/ contains a single file: <code>test.json</code>:</p>
  
  <pre><code>{
      "key": "val"
  }
  </code></pre>
  
  <p>templates/ contains a single configmap that reads test.json: <code>test.yml</code>:</p>
  
  <pre><code>apiVersion: v1
  kind: ConfigMap
  metadata:
    name: json-test
  data:
    test.json: |-
    {{ toJson ( .Files.Get "static/test.json" ) | indent 4}}
  </code></pre>
  
  <p>When I run <code>helm install test . --dry-run --debug</code> I get the following output</p>
  
  <pre><code>NAME: test
  LAST DEPLOYED: Thu Feb  6 10:58:18 2020
  NAMESPACE: default
  STATUS: pending-install
  REVISION: 1
  TEST SUITE: None
  USER-SUPPLIED VALUES:
  {}
  
  COMPUTED VALUES:
  {}
  
  HOOKS:
  MANIFEST:
  ---
  # Source: sandbox/templates/test.yml
  apiVersion: v1
  kind: ConfigMap
  metadata:
    name: json-test
  data:
    test.json: |-
        "{\r\n    \"key\": \"val\"\r\n}"
  </code></pre>
  
  <p>The problem here is my json is wrapped in double quotes. My process that wants to read the json is expecting actual json, not a string.</p>