Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate DHCP network id #1714

Merged
merged 3 commits into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cloud/scope/powervs_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,10 @@ func (m *PowerVSMachineScope) SetAddresses(instance *models.PVMInstance) { //nol
// Get the Details of DHCP server associated with the network
var dhcpServerDetails *models.DHCPServerDetail
for _, server := range dhcpServer {
if server.Network == nil || server.Network.ID == nil {
m.V(3).Info("Skipping the DHCP server as its network details is nil", "DHCP server", *server.ID)
continue
}
if *server.Network.ID == *networkID {
m.Info("found DHCP server for network", "DHCP server ID", *server.ID, "network ID", *networkID)
dhcpServerDetails, err = m.IBMPowerVSClient.GetDHCPServer(*server.ID)
Expand Down