Merge pull request #117226 from princepereira/automated-cherry-pick-of-#116749-upstream-release-1.27

Automated cherry pick of #116749: Adding additional validations to queried endpoint
This commit is contained in:
Kubernetes Prow Robot 2023-07-11 22:53:13 -07:00 committed by GitHub
commit b5c876a05b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.