Skip to content

Commit b1e9c1d

Browse files
authored
fix: [WIN-NPM] HNS Remote Endpoint Fix (#3033)
* changed from getting all endpoints to local endpoints * removed a comment * removed unused function
1 parent 5f4ff11 commit b1e9c1d

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

npm/pkg/dataplane/dataplane_windows.go

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ func (dp *DataPlane) bootupDataPlane() error {
9797
return npmerrors.SimpleErrorWrapper("failed to initialize dataplane", err)
9898
}
9999

100-
// for backwards compatibility, get remote allEndpoints to delete as well
101-
allEndpoints, err := dp.getAllPodEndpoints()
100+
allEndpoints, err := dp.getLocalPodEndpoints()
102101
if err != nil {
103102
return err
104103
}
@@ -328,23 +327,6 @@ func (dp *DataPlane) getEndpointsToApplyPolicies(netPols []*policies.NPMNetworkP
328327
return endpointList, nil
329328
}
330329

331-
func (dp *DataPlane) getAllPodEndpoints() ([]*hcn.HostComputeEndpoint, error) {
332-
klog.Infof("getting all endpoints for network ID %s", dp.networkID)
333-
timer := metrics.StartNewTimer()
334-
endpoints, err := dp.ioShim.Hns.ListEndpointsOfNetwork(dp.networkID)
335-
metrics.RecordListEndpointsLatency(timer)
336-
if err != nil {
337-
metrics.IncListEndpointsFailures()
338-
return nil, npmerrors.SimpleErrorWrapper("failed to get all pod endpoints", err)
339-
}
340-
341-
epPointers := make([]*hcn.HostComputeEndpoint, 0, len(endpoints))
342-
for k := range endpoints {
343-
epPointers = append(epPointers, &endpoints[k])
344-
}
345-
return epPointers, nil
346-
}
347-
348330
func (dp *DataPlane) getLocalPodEndpoints() ([]*hcn.HostComputeEndpoint, error) {
349331
klog.Info("getting local endpoints")
350332
timer := metrics.StartNewTimer()

0 commit comments

Comments
 (0)