Add vSphere network inventory

Project vCenter network inventory through canonical resources and add the vSphere Networks table backed by vCenter network topology. Align resource presentation coalescing so state and resource APIs share the same host contract.
This commit is contained in:
rcourtman
2026-05-22 20:26:56 +01:00
parent 6c7d64ae43
commit 5016cbc2ba
65 changed files with 2025 additions and 437 deletions
@@ -1918,11 +1918,11 @@ func TestResourceAPIHotPathUsesSingleRegistryListSnapshot(t *testing.T) {
source := string(data)
normalizedPath := filepath.ToSlash(path)
if strings.Count(source, "allResources := registry.List()") != 2 {
t.Fatalf("%s: expected HandleListResources and HandleStats to each seed exactly one registry list snapshot", normalizedPath)
if strings.Count(source, "allResources := presentationResourcesFromRegistry(registry)") != 2 {
t.Fatalf("%s: expected HandleListResources and HandleStats to each seed exactly one presentation resource snapshot", normalizedPath)
}
if strings.Count(source, "computeResourceContractByType(allResources)") != 2 {
t.Fatalf("%s: expected canonical by-type aggregations to reuse the seeded registry snapshot in both handlers", normalizedPath)
if strings.Count(source, "computeResourceContractStats(allResources)") != 2 {
t.Fatalf("%s: expected canonical aggregations to reuse the seeded presentation snapshot in both handlers", normalizedPath)
}
if strings.Contains(source, "computeResourceContractByType(registry.List())") {
t.Fatalf("%s: duplicate registry.List() hot-path aggregation detected", normalizedPath)
@@ -2009,6 +2009,8 @@ func TestCloneVMwareDataKeepsNestedRuntimeDetailsIsolated(t *testing.T) {
"out.VirtualDisks = cloneVMwareVirtualDiskDataSlice(in.VirtualDisks)",
"out.ClusterHAEnabled = cloneBoolPtr(in.ClusterHAEnabled)",
"out.ClusterDRSEnabled = cloneBoolPtr(in.ClusterDRSEnabled)",
"out.NetworkHostNames = cloneStringSlice(in.NetworkHostNames)",
"out.NetworkVMNames = cloneStringSlice(in.NetworkVMNames)",
"out.Tools = cloneVMwareToolsData(in.Tools)",
"out.Hardware = cloneVMwareVMHardwareData(in.Hardware)",
"out[i].CreatedAt = cloneTimePtr(in[i].CreatedAt)",