mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-04-28 03:20:11 +00:00
Preserve named guest interfaces without MACs (#1319)
This commit is contained in:
parent
3d27c8f006
commit
3609fb676b
2 changed files with 18 additions and 3 deletions
|
|
@ -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{
|
||||
|
|
|
|||
|
|
@ -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{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue