Fix External DHCP range values for Baremetal configuration
Allow an empty string to be passed in as DHCP range when the DHCP
server is external in a Baremetal IPI installation.
@@ -132,8 +132,12 @@ func getIronicInspectorEndpoint(baremetalConfig BaremetalProvisioningConfig) *st
}
func getProvisioningDHCPRange(baremetalConfig BaremetalProvisioningConfig) *string {
+ // When the DHCP server is external, it is OK for the DHCP range in the CR
+ // to be empty.
if baremetalConfig.ProvisioningDHCPRange != "" {
return &(baremetalConfig.ProvisioningDHCPRange)
+ } else if baremetalConfig.ProvisioningDHCPExternal {
+ return &(baremetalConfig.ProvisioningDHCPRange)
}
return nil
}
