From 913580b9e8a2ac06c076fd2541e6d8d0795956b2 Mon Sep 17 00:00:00 2001 From: Dan Petersen Date: Sun, 15 Mar 2020 23:31:50 +0100 Subject: [PATCH] Fix timeout issue --- CHANGELOG.md | 1 + proxmox/virtual_environment_vm.go | 2 +- proxmox/virtual_environment_vm_types.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f134e009..8d9727d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ BUG FIXES: * resource/virtual_environment_vm: Fix `network_device` deletion issue * resource/virtual_environment_vm: Fix slow refresh when VM is stopped and agent is enabled * resource/virtual_environment_vm: Fix crash caused by assuming IP addresses are always reported by the QEMU agent +* resource/virtual_environment_vm: Fix timeout issue while waiting for IP addresses to be reported by the QEMU agent OTHER: diff --git a/proxmox/virtual_environment_vm.go b/proxmox/virtual_environment_vm.go index c552f27d..a9e3032e 100644 --- a/proxmox/virtual_environment_vm.go +++ b/proxmox/virtual_environment_vm.go @@ -154,7 +154,7 @@ func (c *VirtualEnvironmentClient) WaitForNetworkInterfacesFromVMAgent(nodeName if waitForIP { for _, nic := range *data.Result { - if nic.IPAddresses == nil { + if nic.IPAddresses != nil && len(*nic.IPAddresses) == 0 { missingIP = true break } diff --git a/proxmox/virtual_environment_vm_types.go b/proxmox/virtual_environment_vm_types.go index 4e58480e..cf70a6d3 100644 --- a/proxmox/virtual_environment_vm_types.go +++ b/proxmox/virtual_environment_vm_types.go @@ -301,7 +301,7 @@ type VirtualEnvironmentVMGetQEMUNetworkInterfacesResponseData struct { type VirtualEnvironmentVMGetQEMUNetworkInterfacesResponseResult struct { MACAddress string `json:"hardware-address"` Name string `json:"name"` - Statistics VirtualEnvironmentVMGetQEMUNetworkInterfacesResponseResultStatistics `json:"statistics"` + Statistics *VirtualEnvironmentVMGetQEMUNetworkInterfacesResponseResultStatistics `json:"statistics,omitempty"` IPAddresses *[]VirtualEnvironmentVMGetQEMUNetworkInterfacesResponseResultIPAddress `json:"ip-addresses,omitempty"` }