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?