Skip to content

Commit

Permalink
cni should not invoke cns to release ips for muiltitenancy
Browse files Browse the repository at this point in the history
  • Loading branch information
ZetaoZhuang authored and rbtr committed Nov 8, 2023
1 parent b3faa2f commit 1c4259c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cni/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,10 @@ func (plugin *NetPlugin) Add(args *cniSkel.CmdArgs) error {

defer func() { //nolint:gocritic
if err != nil {
plugin.cleanupAllocationOnError(ipamAddResult.defaultInterfaceInfo.ipResult, nwCfg, args, options)
// for multi-tenancies scenario, CNI is not supposed to invoke CNS for cleaning Ips
if !(nwCfg.MultiTenancy && nwCfg.IPAM.Type == network.AzureCNS) {
plugin.cleanupAllocationOnError(ipamAddResult.defaultInterfaceInfo.ipResult, nwCfg, args, options)
}
}
}()

Expand Down

0 comments on commit 1c4259c

Please sign in to comment.