@@ -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-
348330func (dp * DataPlane ) getLocalPodEndpoints () ([]* hcn.HostComputeEndpoint , error ) {
349331 klog .Info ("getting local endpoints" )
350332 timer := metrics .StartNewTimer ()
0 commit comments