Skip to content

Commit 227be2f

Browse files
committed
update from pr comment
1 parent 19c40d7 commit 227be2f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cni/network/network.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,6 @@ func (plugin *NetPlugin) Add(args *cniSkel.CmdArgs) error {
616616

617617
natInfo := getNATInfo(nwCfg, options[network.SNATIPKey], enableSnatForDNS)
618618
networkID, _ := plugin.getNetworkID(args.Netns, &ifInfo, nwCfg)
619-
policies = append(policies, ipamAddResult.interfaceInfo[key].EndpointPolicies...)
620619

621620
createEpInfoOpt := createEpInfoOpt{
622621
nwCfg: nwCfg,
@@ -834,6 +833,10 @@ func (plugin *NetPlugin) createEpInfo(opt *createEpInfoOpt) (*network.EndpointIn
834833
// create endpoint policies by appending to network policies
835834
// the value passed into NetworkPolicies should be unaffected since we reassign here
836835
opt.policies = append(opt.policies, endpointPolicies...)
836+
837+
// appends default deny endpoint policies if infra nic and default deny bool is enabled
838+
opt.policies = append(opt.policies, opt.ifInfo.EndpointPolicies...)
839+
837840
endpointInfo.EndpointPolicies = opt.policies
838841
// add even more endpoint policies
839842
epPolicies, err := getPoliciesFromRuntimeCfg(opt.nwCfg, opt.ipamAddResult.ipv6Enabled) // not specific to delegated or infra

0 commit comments

Comments
 (0)