From f59ac6e6524cd61302323ebb9f2344dca375e8a4 Mon Sep 17 00:00:00 2001 From: Prince Pereira Date: Mon, 20 Mar 2023 02:58:54 -0700 Subject: [PATCH] [WinProxy] Adding additional validations to queried endpoint list iteration. --- pkg/proxy/winkernel/hns.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/proxy/winkernel/hns.go b/pkg/proxy/winkernel/hns.go index 1f31c94e636..f7e6dd8fe9b 100644 --- a/pkg/proxy/winkernel/hns.go +++ b/pkg/proxy/winkernel/hns.go @@ -97,6 +97,12 @@ func (hns hns) getAllEndpointsByNetwork(networkName string) (map[string]*(endpoi } endpointInfos := make(map[string]*(endpointsInfo)) for _, ep := range endpoints { + + if len(ep.IpConfigurations) == 0 { + klog.V(3).InfoS("No IpConfigurations found in endpoint info of queried endpoints", "endpoint", ep) + continue + } + // Add to map with key endpoint ID or IP address // Storing this is expensive in terms of memory, however there is a bug in Windows Server 2019 that can cause two endpoints to be created with the same IP address. // TODO: Store by IP only and remove any lookups by endpoint ID.