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:
whitelist-ip-ranges: |-
- 10.0.0.0/24
- 11.0.0.0/24
- 12.0.0.0/24
My pipeline is like:
....
....
....
params:
variables:
loadBalancerSourceRanges:
{{whitelist-ip-ranges}}
And I want it to be:
....
....
....
params:
variables:
loadBalancerSourceRanges:
- 10.0.0.0/24
- 11.0.0.0/24
- 12.0.0.0/24
or
....
....
....
params:
variables:
loadBalancerSourceRanges: [10.0.0.0/24,11.0.0.0/24,12.0.0.0/24]
Inside my helm template I have my values.yaml file I have of course:
loadBalancerSourceRanges: null
and it will be override by the pipeline. And finaly, in my service file I'm making a loop:
{{if .Values.loadBalancerSourceRanges}}
loadBalancerSourceRanges:
{{range $rangeList := .Values.loadBalancerSourceRanges}}
- {{ $rangeList }}
{{end}}
{{end}}
Does any of you guys was able to do something like that?
I'm sorry, I cannot speak to anything helm
based. I can speak for a concourse pipeline, though.
Concourse does not support providing params
to tasks that are an array. params
are passed in as environment variables to a running task, so they are transformed from YAML to a simple string key-value pair.
If you want to pass more complex information. There are two options:
loadBalanceSourceRanges
These programmatic ways are examples I've used before to accomplish passing more complex data (ie arrays) to a task.