Skip to content

Commit

Permalink
Merge pull request openshift#7985 from vr4manta/OCPBUGS-29114
Browse files Browse the repository at this point in the history
OCPBUGS-29114: Fixed control plane machine set handling of static IPs when AddressesFromPools is not in use.
  • Loading branch information
openshift-merge-bot[bot] authored Feb 8, 2024
2 parents d7742ee + 4f7bae9 commit ef713aa
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions pkg/asset/machines/vsphere/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,19 @@ func Machines(clusterID string, config *types.InstallConfig, pool *types.Machine
vsphereMachineProvider.Template = ""
}

// Only set AddressesFromPools and Nameservers if AddressesFromPools is > 0, else revert to
// the older static IP manifest way.
if len(hosts) > 0 {
vsphereMachineProvider.Network.Devices = []machineapi.NetworkDeviceSpec{
{
AddressesFromPools: origProv.Network.Devices[0].AddressesFromPools,
Nameservers: origProv.Network.Devices[0].Nameservers,
},
if len(origProv.Network.Devices[0].AddressesFromPools) > 0 {
vsphereMachineProvider.Network.Devices = []machineapi.NetworkDeviceSpec{
{
AddressesFromPools: origProv.Network.Devices[0].AddressesFromPools,
Nameservers: origProv.Network.Devices[0].Nameservers,
},
}
} else {
// Older static IP config, lets remove network since it'll come from FD
vsphereMachineProvider.Network = machineapi.NetworkSpec{}
}
}

Expand Down

0 comments on commit ef713aa

Please sign in to comment.