Preserve named guest interfaces without MACs (#1319)

This commit is contained in:
rcourtman 2026-03-27 15:25:52 +00:00
parent 3d27c8f006
commit 3609fb676b
2 changed files with 18 additions and 3 deletions

View file

@ -611,9 +611,9 @@ func processGuestNetworkInterfaces(raw []proxmox.VMNetworkInterface) ([]string,
if ifaceName == "" || lowerName == "lo" || lowerName == "loopback" {
continue
}
if mac == "" || mac == "00:00:00:00:00:00" {
continue
}
// Preserve named non-loopback interfaces even when early/partial guest-agent
// payloads have not populated MAC or IP details yet. The interface identity
// is still useful for the VM Summary view and should not wait for a later poll.
}
guestIfaces = append(guestIfaces, models.GuestNetworkInterface{

View file

@ -557,6 +557,21 @@ func TestProcessGuestNetworkInterfaces(t *testing.T) {
{Name: "eth0", MAC: "00:11:22:33:44:55", Addresses: nil},
},
},
{
name: "interface with name only still keeps non-loopback identity",
raw: []proxmox.VMNetworkInterface{
{
Name: "Ethernet 2",
HardwareAddr: "",
IPAddresses: nil,
Statistics: nil,
},
},
wantIPs: []string{},
wantIfaces: []models.GuestNetworkInterface{
{Name: "Ethernet 2", MAC: "", Addresses: nil},
},
},
{
name: "loopback-only interface with no IPs and no traffic is excluded",
raw: []proxmox.VMNetworkInterface{