<p>I have the following values.yaml</p>

<pre><code>documentStorage:
  folders:
    TEST1:
      permissions:
        read: "test1@email.com"
        write: "test1@email.com"
    TEST2:
      permissions:
       read: "test2@email.com"
       write: "test2@email.com"
</code></pre>

<p>And, I want to move that to my config map, but, since the keys under folder can be extended, I would like to use the range functionality. And also, I would like to copy the exact structure under it, if possible:</p>

<pre><code>documentStorage:
  folders:
    {{- range $folder, $structure := .Values.global.documentStorage.folders }}
      {{ $folder }}: {{ $structure }}
    {{- end}}
</code></pre>

<p>But, it isn't working, and I get this:</p>

<pre><code>folders:
  TEST1:
    permissions: map[read:test1@email.com write:test1@email.com]
  TEST2:
    permissions: map[read:test2@email.com write:test2@email.com]
</code></pre>

<p>What am I missing?</p>

Manuelarte
<p>Use the following snippet. You'd need to change the value of indent depending on what nesting level you are setting documentStorage at</p>

<pre><code>  documentStorage:
    folders:
{{ .Values.documentStorage.folders | toYaml | indent 6 }}
</code></pre>
