Commit b4456f81 authored by Waqar Ahmed's avatar Waqar Ahmed

Fix scope issue inside loop

parent 08b3e9e5
......@@ -66,5 +66,5 @@ Create the name of the service account to use
Name for external interfaces to be added to chart
*/}}
{{- define "externalInterfaceName" -}}
{{- printf "%s" .Release.Name }}
{{- printf "ix-%s" $.Release.Name }}
{{- end }}
......@@ -14,11 +14,8 @@ spec:
{{- include "ix-chart.selectorLabels" . | nindent 8 }}
annotations:
rollme: {{ randAlphaNum 5 | quote }}
{{- if .Values.externalInterfaces }}
k8s.v1.cni.cncf.io/networks:
{{- range $index, $iface := .Values.externalInterfaces }}
- {{ include "externalInterfaceName" . }}-{{ $index }}
{{- end }}
{{- if .Values.externalInterfacesConfigurationNames }}
k8s.v1.cni.cncf.io/networks: {{ join ", " .Values.externalInterfacesConfigurationNames }}
{{- end }}
spec:
containers:
......
{{- range $index, $iface := .Values.externalInterfaces }}
{{- range $index, $iface := .Values.externalInterfacesConfiguration }}
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: {{ include "externalInterfaceName" . }}-{{ $index }}
name: ix-{{ $.Release.Name }}-{{ $index }}
spec:
config: '{{ $iface }}'
----------------------------------------------------------
{{- end }}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment