File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -834,7 +834,7 @@ func (plugin *NetPlugin) createEpInfo(opt *createEpInfoOpt) (*network.EndpointIn
834834 // the value passed into NetworkPolicies should be unaffected since we reassign here
835835 opt .policies = append (opt .policies , endpointPolicies ... )
836836
837- // appends default deny endpoint policies if infra nic and default deny bool is enabled
837+ // appends endpoint policies specific to this interface
838838 opt .policies = append (opt .policies , opt .ifInfo .EndpointPolicies ... )
839839
840840 endpointInfo .EndpointPolicies = opt .policies
Original file line number Diff line number Diff line change @@ -901,6 +901,12 @@ func GetTestCNSResponseSecondaryWindows(macAddress string) map[string]network.In
901901 },
902902 },
903903 NICType : cns .NodeNetworkInterfaceFrontendNIC ,
904+ EndpointPolicies : []policy.Policy {
905+ {
906+ Type : policy .EndpointPolicy ,
907+ Data : GetRawOutBoundNATPolicy (),
908+ },
909+ },
904910 },
905911 }
906912}
@@ -1281,6 +1287,12 @@ func TestPluginWindowsAdd(t *testing.T) {
12811287 Gateway : net .ParseIP ("10.241.0.1" ),
12821288 },
12831289 },
1290+ EndpointPolicies : []policy.Policy {
1291+ {
1292+ Type : policy .EndpointPolicy ,
1293+ Data : GetRawOutBoundNATPolicy (),
1294+ },
1295+ },
12841296 },
12851297 epIDRegex : `.*` ,
12861298 },
@@ -1338,6 +1350,8 @@ func TestPluginWindowsAdd(t *testing.T) {
13381350 epInfo1 .EndpointPolicies [0 ] = policy.Policy {
13391351 Type : policy .ACLPolicy ,
13401352 }
1353+ require .Equal (t , len (epInfo1 .EndpointPolicies ), 1 )
1354+ require .Equal (t , len (epInfo2 .EndpointPolicies ), 1 )
13411355 require .NotEqual (t , epInfo1 .EndpointPolicies , epInfo2 .EndpointPolicies )
13421356 }
13431357 // ensure the network policy slices are separate entities when in separate endpoint infos
You can’t perform that action at this time.
0 commit comments