<p>i want to pass two arguments to the to &quot;deployment template&quot; from the values.yaml the result should be like this :
<a href="https://i.stack.imgur.com/FXa4H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FXa4H.png" alt="enter image description here" /></a></p>
<p>in values.yaml i have this   &gt;&gt;&gt;
<a href="https://i.stack.imgur.com/V6ibQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V6ibQ.png" alt="enter image description here" /></a></p>
<p>And here is my template deployment file :</p>
<pre><code>{{ if .Values.containerCommand }}
      command: [{{ .Values.containerCommand }}] 
{{ end }}
</code></pre>
<p>The questions is how can i pass two arguments to &quot;containerCommand&quot; value.</p>
<p>Because when i want to these arguments to the helm, i got an error:</p>
<p>I got an error Error: UPGRADE FAILED: error validating &quot;&quot;: error validating data: ValidationError(Deployment.spec.template.spec.containers[0].command[0]): invalid type for io.k8s.api.core.v1.Container.command: got &quot;array&quot;, expected &quot;string&quot;</p>

Amir Damirov
<p>You can iterate through the collection using <code>range</code> operator, like following</p>
<pre><code>
{{ if .Values.containerCommand }}
      command: {{- range .Values.containerCommand }}
        - {{ . }} {{- end}}
{{- end}}
</code></pre>
<p>To learn details check <a href="https://helm.sh/docs/chart_template_guide/control_structures/" rel="nofollow noreferrer">here</a></p>
