commit fef5d0bb26081253eab0bc7894aa1c0265f500ad Author: Matt McEuen Date: Fri Aug 28 08:52:31 2020 -0500 hostgenerator-m3: make profile optional Previously, if a user wanted a host to use the default hardwareProfile that is defined in the `hostgenerator-m3` function, they had to specify `hostProfile: default` in their host catalogue. With this change, the profile may simply be ommitted, in which case the default profile will be used automatically. Change-Id: I368f406c4c852d7f2499d7ac7961e15cb4490305 diff --git a/manifests/function/hostgenerator-m3/hosttemplate.yaml b/manifests/function/hostgenerator-m3/hosttemplate.yaml index 3de8bdc..dc363c6 100644 --- a/manifests/function/hostgenerator-m3/hosttemplate.yaml +++ b/manifests/function/hostgenerator-m3/hosttemplate.yaml @@ -27,6 +27,10 @@ template: | {{- range .hostsToGenerate }} {{- $hostName := . }} {{- $host := index $envAll.hosts $hostName }} + {{- /* If no hardwareProfile is defined for a host, use the default */ -}} + {{- if not $host.hardwareProfile }} + {{- $_ := set $host "hardwareProfile" "default" }} + {{- end }} {{- $hardwareProfile := index $envAll.hardwareProfiles $host.hardwareProfile }} --- apiVersion: metal3.io/v1alpha1