Add support for IPv6 to machine and cluster chart
[icn.git] / deploy / machine / templates / _nodeip.yaml
1 {{- define "machine.nodeIP" -}}
2 {{- $nodeIPs := "" -}}
3 {{- $local := dict "first" true -}}
4 {{- range $name, $network := .networks.ipv4 -}}
5 {{- $link := $network.link | default $name -}}
6 {{- if eq $link "baremetal" -}}
7 {{- if not $local.first -}}
8 {{- $nodeIPs = printf "%s,%s" $nodeIPs (regexReplaceAll "/.*$" $network.ipAddress "") -}}
9 {{- else -}}
10 {{- $nodeIPs = regexReplaceAll "/.*$" $network.ipAddress "" -}}
11 {{- end -}}
12 {{- $_ := set $local "first" false -}}
13 {{- end -}}
14 {{- end -}}
15 {{- range $name, $network := .networks.ipv6 -}}
16 {{- $link := $network.link | default $name -}}
17 {{- if eq $link "baremetal" -}}
18 {{- if not $local.first -}}
19 {{- $nodeIPs = printf "%s,%s" $nodeIPs (regexReplaceAll "/.*$" $network.ipAddress "") -}}
20 {{- else -}}
21 {{- $nodeIPs = regexReplaceAll "/.*$" $network.ipAddress "" -}}
22 {{- end -}}
23 {{- $_ := set $local "first" false -}}
24 {{- end -}}
25 {{- end -}}
26 icn.akraino.org/node-ip: {{ $nodeIPs }}
27 {{- end -}}