Merge "Fix Templater condition issue"

This commit is contained in:
Zuul 2021-10-01 16:28:18 +00:00 committed by Gerrit Code Review
commit 614f7fe3bc
2 changed files with 6 additions and 2 deletions

View File

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

View File

@ -92,10 +92,12 @@ template: |
{{- range $envAll.commonNetworking.links }} {{- range $envAll.commonNetworking.links }}
- -
{{ toYaml . | indent 6 }} {{ 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 }} ethernet_mac_address: {{ index $host.macAddresses .id }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }}
networks: networks:
{{- range $envAll.commonNetworking.networks }} {{- range $envAll.commonNetworking.networks }}
- -