<p>I have the following in my dep.yml <code>{{ toYaml .Values.volumes | indent 8 }}</code> which takes an array from <code>values.yml</code> of volumes and then loads it on the dep.yml file.</p>

<p>I want the following result on my dep.yml from the initial array</p>

<pre><code> volumes:
    - name: volume
      persistentVolumeClaim:
        claimName: {{ Release.Name }}-volume-claim
    - name: volume-a
      persistentVolumeClaim:
        claimName: {{ Release.Name }}-volume-a-claim
    - name: volume-b
      persistentVolumeClaim:
        claimName: {{ Release.Name }}-volume-b-claim
</code></pre>

<p>Adding the <code>{{ Release.Name }}</code> dynamically to the volume claim name for each element of the array.</p>

<p>Is there any way to achieve this modifying the <code>{{ toYaml .Values.volumes | indent 8 }}</code> directive? </p>

gusgleuy
<p>Helm includes <a href="https://helm.sh/docs/developing_charts/#using-the-tpl-function" rel="noreferrer">a <code>tpl</code> function</a> that expands template content in a string.  I would fit this into the pipeline after rendering the value to a string, but before indenting it; its parameters don't quite fit into the standard pipeline setup.</p>

<pre><code>{{ tpl (toYaml .Values.volumes) . | indent 8 }}
</code></pre>
