Skip to content

Commit 6dde355

Browse files
committed
added if condition with logic
1 parent 605a498 commit 6dde355

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

npm/pkg/dataplane/dataplane_windows.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,21 @@ func (dp *DataPlane) initializeDataPlane() error {
6161

6262
// Filter out any endpoints that are not in "AttachedShared" State. All running Windows pods with networking must be in this state.
6363
filterMap := map[string]uint16{"State": hcnEndpointStateAttachedSharing}
64-
filterMapL1VH := map[string]uint16{"State": hcnEndpointStateAttached}
65-
6664
filter, err := json.Marshal(filterMap)
6765
if err != nil {
6866
return errors.Wrap(err, "failed to marshal endpoint filter map")
6967
}
68+
dp.endpointQuery.query.Filter = string(filter)
7069

71-
filterL1VH, errL1VH := json.Marshal(filterMapL1VH)
72-
if errL1VH != nil {
73-
return errors.Wrap(errL1VH, "failed to marshal endpoint filter map")
70+
if dp.EnableNPMLite {
71+
filterMapL1VH := map[string]uint16{"State": hcnEndpointStateAttached}
72+
filterL1VH, errL1VH := json.Marshal(filterMapL1VH)
73+
if errL1VH != nil {
74+
return errors.Wrap(errL1VH, "failed to marshal endpoint filter map")
75+
}
76+
dp.endpointQueryL1VH.query.Filter = string(filterL1VH)
7477
}
7578

76-
dp.endpointQuery.query.Filter = string(filter)
77-
dp.endpointQueryL1VH.query.Filter = string(filterL1VH)
78-
7979
// reset endpoint cache so that netpol references are removed for all endpoints while refreshing pod endpoints
8080
// no need to lock endpointCache at boot up
8181
dp.endpointCache.cache = make(map[string]*npmEndpoint)

0 commit comments

Comments
 (0)