@@ -482,10 +482,10 @@ func (plugin *netPlugin) Add(args *cniSkel.CmdArgs) error {
482482 defer func () {
483483 if err != nil {
484484 if result != nil && len (result .IPs ) > 0 {
485- plugin .ipamInvoker .Delete (& result .IPs [0 ].Address , nwCfg , options )
485+ plugin .ipamInvoker .Delete (& result .IPs [0 ].Address , nwCfg , epInfo , options )
486486 }
487487 if resultV6 != nil && len (resultV6 .IPs ) > 0 {
488- plugin .ipamInvoker .Delete (& resultV6 .IPs [0 ].Address , nwCfg , options )
488+ plugin .ipamInvoker .Delete (& resultV6 .IPs [0 ].Address , nwCfg , epInfo , options )
489489 }
490490 }
491491 }()
@@ -586,10 +586,10 @@ func (plugin *netPlugin) Add(args *cniSkel.CmdArgs) error {
586586 defer func () {
587587 if err != nil {
588588 if result != nil && len (result .IPs ) > 0 {
589- plugin .ipamInvoker .Delete (& result .IPs [0 ].Address , nwCfg , nwInfo .Options )
589+ plugin .ipamInvoker .Delete (& result .IPs [0 ].Address , nwCfg , epInfo , nwInfo .Options )
590590 }
591591 if resultV6 != nil && len (resultV6 .IPs ) > 0 {
592- plugin .ipamInvoker .Delete (& resultV6 .IPs [0 ].Address , nwCfg , nwInfo .Options )
592+ plugin .ipamInvoker .Delete (& resultV6 .IPs [0 ].Address , nwCfg , epInfo , nwInfo .Options )
593593 }
594594 }
595595 }()
@@ -889,7 +889,7 @@ func (plugin *netPlugin) Delete(args *cniSkel.CmdArgs) error {
889889 if ! nwCfg .MultiTenancy {
890890 // attempt to release address associated with this Endpoint id
891891 // This is to ensure clean up is done even in failure cases
892- err = plugin .ipamInvoker .Delete (nil , nwCfg , nwInfo .Options )
892+ err = plugin .ipamInvoker .Delete (nil , nwCfg , epInfo , nwInfo .Options )
893893 if err != nil {
894894 log .Printf ("Network not found, attempted to release address with error: %v" , err )
895895 }
@@ -908,7 +908,7 @@ func (plugin *netPlugin) Delete(args *cniSkel.CmdArgs) error {
908908 // attempt to release address associated with this Endpoint id
909909 // This is to ensure clean up is done even in failure cases
910910 log .Printf ("release ip ep not found" )
911- if err = plugin .ipamInvoker .Delete (nil , nwCfg , nwInfo .Options ); err != nil {
911+ if err = plugin .ipamInvoker .Delete (nil , nwCfg , epInfo , nwInfo .Options ); err != nil {
912912 log .Printf ("Endpoint not found, attempted to release address with error: %v" , err )
913913 }
914914 }
@@ -931,7 +931,7 @@ func (plugin *netPlugin) Delete(args *cniSkel.CmdArgs) error {
931931 // Call into IPAM plugin to release the endpoint's addresses.
932932 for _ , address := range epInfo .IPAddresses {
933933 log .Printf ("release ip:%s" , address .IP .String ())
934- err = plugin .ipamInvoker .Delete (& address , nwCfg , nwInfo .Options )
934+ err = plugin .ipamInvoker .Delete (& address , nwCfg , epInfo , nwInfo .Options )
935935 if err != nil {
936936 err = plugin .Errorf ("Failed to release address %v with error: %v" , address , err )
937937 return err
@@ -940,7 +940,7 @@ func (plugin *netPlugin) Delete(args *cniSkel.CmdArgs) error {
940940 } else if epInfo .EnableInfraVnet {
941941 nwCfg .Ipam .Subnet = nwInfo .Subnets [0 ].Prefix .String ()
942942 nwCfg .Ipam .Address = epInfo .InfraVnetIP .IP .String ()
943- err = plugin .ipamInvoker .Delete (nil , nwCfg , nwInfo .Options )
943+ err = plugin .ipamInvoker .Delete (nil , nwCfg , epInfo , nwInfo .Options )
944944 if err != nil {
945945 log .Printf ("Failed to release address: %v" , err )
946946 err = plugin .Errorf ("Failed to release address %v with error: %v" , nwCfg .Ipam .Address , err )
0 commit comments