Fix scope issue inside loop
This commit is contained in:
parent
08b3e9e5c9
commit
b4456f81f7
|
@ -66,5 +66,5 @@ Create the name of the service account to use
|
||||||
Name for external interfaces to be added to chart
|
Name for external interfaces to be added to chart
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "externalInterfaceName" -}}
|
{{- define "externalInterfaceName" -}}
|
||||||
{{- printf "%s" .Release.Name }}
|
{{- printf "ix-%s" $.Release.Name }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -14,11 +14,8 @@ spec:
|
||||||
{{- include "ix-chart.selectorLabels" . | nindent 8 }}
|
{{- include "ix-chart.selectorLabels" . | nindent 8 }}
|
||||||
annotations:
|
annotations:
|
||||||
rollme: {{ randAlphaNum 5 | quote }}
|
rollme: {{ randAlphaNum 5 | quote }}
|
||||||
{{- if .Values.externalInterfaces }}
|
{{- if .Values.externalInterfacesConfigurationNames }}
|
||||||
k8s.v1.cni.cncf.io/networks:
|
k8s.v1.cni.cncf.io/networks: {{ join ", " .Values.externalInterfacesConfigurationNames }}
|
||||||
{{- range $index, $iface := .Values.externalInterfaces }}
|
|
||||||
- {{ include "externalInterfaceName" . }}-{{ $index }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{{- range $index, $iface := .Values.externalInterfaces }}
|
{{- range $index, $iface := .Values.externalInterfacesConfiguration }}
|
||||||
|
---
|
||||||
apiVersion: "k8s.cni.cncf.io/v1"
|
apiVersion: "k8s.cni.cncf.io/v1"
|
||||||
kind: NetworkAttachmentDefinition
|
kind: NetworkAttachmentDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "externalInterfaceName" . }}-{{ $index }}
|
name: ix-{{ $.Release.Name }}-{{ $index }}
|
||||||
spec:
|
spec:
|
||||||
config: '{{ $iface }}'
|
config: '{{ $iface }}'
|
||||||
----------------------------------------------------------
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
Loading…
Reference in New Issue