From 9fd9d211d75e760ef1c7e44d13de9ce8d38bf834 Mon Sep 17 00:00:00 2001 From: mandrav Date: Tue, 15 Aug 2023 04:22:50 +0300 Subject: [PATCH] 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. --- proxmox/nodes/vms/vms.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxmox/nodes/vms/vms.go b/proxmox/nodes/vms/vms.go index 7735f6a6..eb0854e2 100644 --- a/proxmox/nodes/vms/vms.go +++ b/proxmox/nodes/vms/vms.go @@ -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 {