@@ -350,15 +350,23 @@ func (dp *DataPlane) getEndpointsToApplyPolicies(netPols []*policies.NPMNetworkP
350350func (dp * DataPlane ) getLocalPodEndpoints () ([]* hcn.HostComputeEndpoint , error ) {
351351 klog .Info ("getting local endpoints" )
352352 timer := metrics .StartNewTimer ()
353- endpointsAttachedSharing , err := dp .ioShim .Hns .ListEndpointsQuery (dp .endpointQuery .query )
354- endpointsAttached , err := dp . ioShim . Hns . ListEndpointsQuery ( dp . endpointQueryL1VH . query )
353+ endpoints , err := dp .ioShim .Hns .ListEndpointsQuery (dp .endpointQuery .query )
354+ klog . Infof ( "There are %+v endpoints in AttachedSharing state" , len ( endpoints ) )
355355 metrics .RecordListEndpointsLatency (timer )
356356 if err != nil {
357357 metrics .IncListEndpointsFailures ()
358358 return nil , npmerrors .SimpleErrorWrapper ("failed to get local pod endpoints" , err )
359359 }
360- endpoints := append (endpointsAttachedSharing , endpointsAttached ... )
361- klog .Infof ("there are %+v endpoints in endpointsAttachedSharing and %+v endpoints in Attached" , len (endpointsAttachedSharing ), len (endpointsAttached ))
360+ if dp .EnableNPMLite {
361+ timer = metrics .StartNewTimer ()
362+ endpointsAttached , errL1vh := dp .ioShim .Hns .ListEndpointsQuery (dp .endpointQueryL1VH .query )
363+ if errL1vh != nil {
364+ metrics .IncListEndpointsFailures ()
365+ return nil , npmerrors .SimpleErrorWrapper ("failed to get local pod endpoints in L1VH" , err )
366+ }
367+ klog .Infof ("There are %+v endpoints in Attached state on l1vh" , len (endpointsAttached ))
368+ endpoints = append (endpoints , endpointsAttached ... )
369+ }
362370 epPointers := make ([]* hcn.HostComputeEndpoint , 0 , len (endpoints ))
363371 for k := range endpoints {
364372 epPointers = append (epPointers , & endpoints [k ])
0 commit comments