<p>I'm trying to figure out how to create an array with some CIDR ip address in order to have the same array in my pipeline. So here is an example var file:</p>

<pre><code>whitelist-ip-ranges: |-
- 10.0.0.0/24
- 11.0.0.0/24
- 12.0.0.0/24
</code></pre>

<p>My pipeline is like:</p>

<pre><code>....
....
....
params:
     variables:
        loadBalancerSourceRanges:
          {{whitelist-ip-ranges}}
</code></pre>

<p>And I want it to be:</p>

<pre><code>....
....
....
params:
     variables:
        loadBalancerSourceRanges:
          - 10.0.0.0/24
          - 11.0.0.0/24
          - 12.0.0.0/24
</code></pre>

<p>or</p>

<pre><code>....
....
....
params:
     variables:
        loadBalancerSourceRanges: [10.0.0.0/24,11.0.0.0/24,12.0.0.0/24]
</code></pre>

<p>Inside my helm template I have my values.yaml file I have of course:</p>

<pre><code>loadBalancerSourceRanges: null
</code></pre>

<p>and it will be override by the pipeline.
And finaly, in my service file I'm making a loop:</p>

<pre><code>{{if .Values.loadBalancerSourceRanges}}
  loadBalancerSourceRanges:
    {{range $rangeList := .Values.loadBalancerSourceRanges}}
    - {{ $rangeList }}
    {{end}}
{{end}}
</code></pre>

<p>Does any of you guys was able to do something like that?</p>

<p>I'm sorry, I cannot speak to anything <code>helm</code> based. I can speak for a concourse pipeline, though.</p>

<p>Concourse does not support providing <code>params</code> to tasks that are an array. <code>params</code> are passed in as environment variables to a running task, so they are transformed from YAML to a simple string key-value pair.</p>

<p>If you want to pass more complex information. There are two options:</p>

<ul>
<li>encode the param as JSON/YAML so that it can be parsed as string from your tasks environment</li>
<li>provide the task an input from a resource, where a file can be provided -- for example an s3 resource with the contents of the <code>loadBalanceSourceRanges</code></li>
</ul>

<p>These programmatic ways are examples I've used before to accomplish passing more complex data (ie arrays) to a task.</p>
