mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-06-30 10:33:46 +00:00
fix(vm): no IP address detection when VM contains bridges (#493)
When the VM contains at least one bridge, the main interface (e.g. `eth0`) is left without an IP address because that's how networks usually work. The code that queries the VM's IP addresses (through the guest agent), loops all available interfaces to find one. The existing code though would prematurely exit the loop if the interface it was checking had no IP address assigned. Like the aforementioned `eth0`, when it is controlled by a bridge. This patch fixes this problem by not exiting the loop, instead just continuing to the next interface.
This commit is contained in:
parent
9045183c1d
commit
9fd9d211d7
@ -445,7 +445,7 @@ func (c *Client) WaitForNetworkInterfacesFromVMAgent(
|
||||
|
||||
if nic.IPAddresses == nil ||
|
||||
(nic.IPAddresses != nil && len(*nic.IPAddresses) == 0) {
|
||||
break
|
||||
continue
|
||||
}
|
||||
|
||||
for _, addr := range *nic.IPAddresses {
|
||||
|
Loading…
Reference in New Issue
Block a user