Skip to content

Commit 424df6a

Browse files
committed
added code to fix no endpoints been seen in hns network for npm lite in l1vh node
1 parent 3ed0bcd commit 424df6a

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

npm/examples/windows/azure-npm-lite-win.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ data:
154154
"ApplyIPSetsOnNeed": false,
155155
"ApplyInBackground": true,
156156
"NetPolInBackground": true
157-
"EnableNPMLite": true
157+
"EnableNPMLite": true,
158+
"IsL1VHNode": true
158159
}
159160
}

npm/pkg/dataplane/dataplane.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ type Config struct {
4545
NetPolInBackground bool
4646
MaxPendingNetPols int
4747
NetPolInterval time.Duration
48+
IsL1VHNode bool
49+
EnableNPMLite bool
4850
*ipsets.IPSetManagerCfg
4951
*policies.PolicyManagerCfg
5052
}

npm/pkg/dataplane/dataplane_windows.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ func (dp *DataPlane) initializeDataPlane() error {
5252
}
5353
// Filter out any endpoints that are not in "AttachedShared" State. All running Windows pods with networking must be in this state.
5454
filterMap := map[string]uint16{"State": hcnEndpointStateAttachedSharing}
55+
56+
// if npm lite is enabled and running on l1vh node, filter out any endpoints that are not in "Attached" State
57+
if dp.EnableNPMLite && dp.IsL1VHNode {
58+
filterMap = map[string]uint16{"State": hcnEndpointStateAttached}
59+
}
60+
5561
filter, err := json.Marshal(filterMap)
5662
if err != nil {
5763
return npmerrors.SimpleErrorWrapper("failed to marshal endpoint filter map", err)

0 commit comments

Comments
 (0)