mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-06-30 18:42:58 +00:00
fix: Wait for 'net.IsGlobalUnicast' IP address, again (#100) VM can get IPv6 link-local address faster than a DHCP server response, that results in 'ipv4_addresses' output being an empty list. It is then impossible to provision the VM using 'connection.host' field derived from 'self.ipv4_addresses'. Once again change waiting for IP address to wait for better address than IPv4 link-local addresses and IPv6 link-local addresses. Should not break #182, because it requires only one GlobalUnicast address per VM.
This commit is contained in:
parent
18fceb8734
commit
20131b0ffc
@ -667,7 +667,6 @@ func (c *VirtualEnvironmentClient) WaitForNetworkInterfacesFromVMAgent(
|
||||
data, err := c.GetVMNetworkInterfacesFromAgent(ctx, nodeName, vmID)
|
||||
|
||||
if err == nil && data != nil && data.Result != nil {
|
||||
missingIP := false
|
||||
hasAnyGlobalUnicast := false
|
||||
|
||||
if waitForIP {
|
||||
@ -678,7 +677,6 @@ func (c *VirtualEnvironmentClient) WaitForNetworkInterfacesFromVMAgent(
|
||||
|
||||
if nic.IPAddresses == nil ||
|
||||
(nic.IPAddresses != nil && len(*nic.IPAddresses) == 0) {
|
||||
missingIP = true
|
||||
break
|
||||
}
|
||||
|
||||
@ -690,7 +688,7 @@ func (c *VirtualEnvironmentClient) WaitForNetworkInterfacesFromVMAgent(
|
||||
}
|
||||
}
|
||||
|
||||
if hasAnyGlobalUnicast || !missingIP {
|
||||
if hasAnyGlobalUnicast {
|
||||
return data, err
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user