From ab735cc4604fe500ccb341f474f001b098c581d7 Mon Sep 17 00:00:00 2001 From: rejain456 Date: Fri, 10 Jan 2025 15:15:43 -0800 Subject: [PATCH] removed for loop --- cni/network/network.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cni/network/network.go b/cni/network/network.go index 378084bc03..ce5fafd8b7 100644 --- a/cni/network/network.go +++ b/cni/network/network.go @@ -590,9 +590,7 @@ func (plugin *NetPlugin) Add(args *cniSkel.CmdArgs) error { } policies := cni.GetPoliciesFromNwCfg(nwCfg.AdditionalArgs) - for key := range ipamAddResult.interfaceInfo { - policies = append(policies, ipamAddResult.interfaceInfo[key].EndpointPolicies...) - } + // moved to addIpamInvoker // sendEvent(plugin, fmt.Sprintf("Allocated IPAddress from ipam interface: %+v", ipamAddResult.PrettyString())) @@ -619,6 +617,7 @@ func (plugin *NetPlugin) Add(args *cniSkel.CmdArgs) error { natInfo := getNATInfo(nwCfg, options[network.SNATIPKey], enableSnatForDNS) networkID, _ := plugin.getNetworkID(args.Netns, &ifInfo, nwCfg) + policies = append(policies, ipamAddResult.interfaceInfo[key].EndpointPolicies...) createEpInfoOpt := createEpInfoOpt{ nwCfg: nwCfg,