diff --git a/krm-functions/templater/local-resource/example-use.yaml b/krm-functions/templater/local-resource/example-use.yaml index 981987d8d..7ad5b6bd8 100644 --- a/krm-functions/templater/local-resource/example-use.yaml +++ b/krm-functions/templater/local-resource/example-use.yaml @@ -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 -}} diff --git a/manifests/function/hostgenerator-m3/hosttemplate.yaml b/manifests/function/hostgenerator-m3/hosttemplate.yaml index 4e641fd81..3b2a3bd6e 100644 --- a/manifests/function/hostgenerator-m3/hosttemplate.yaml +++ b/manifests/function/hostgenerator-m3/hosttemplate.yaml @@ -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 }} -