Fix Templater condition issue

* for some reason the one liner with multiple conditions is not
  working and due to which the generation of ethernet_mac_address
  is completely ignored

Change-Id: I642fc744c039cafbbd9cea48f861931fb67948c1
This commit is contained in:
Siraj Yasin 2021-09-29 21:07:07 +00:00
parent 23ccec608c
commit 8b9f1b4fd0
2 changed files with 6 additions and 2 deletions

View File

@ -36,7 +36,9 @@ template: |
metadata:
name: {{ .name }}
spec:
{{- if and (.macAddresses) (.macAddresses.oam) }}
{{- if .macAddresses }}
{{- if .macAddresses.oam }}
bootMACAddress: {{ .macAddresses.oam }}
{{- end }}
{{- end }}
{{ end -}}

View File

@ -92,10 +92,12 @@ template: |
{{- range $envAll.commonNetworking.links }}
-
{{ toYaml . | indent 6 }}
{{- if and ($host.macAddresses) (index $host.macAddresses .id) }}
{{- if $host.macAddresses }}
{{- if index $host.macAddresses .id }}
ethernet_mac_address: {{ index $host.macAddresses .id }}
{{- end }}
{{- end }}
{{- end }}
networks:
{{- range $envAll.commonNetworking.networks }}
-