Have ipam.ExecDel set CNI_COMMAND to DEL

This commit is contained in:
Michael Cambria
2019-05-03 17:17:58 -04:00
parent a03e6b505e
commit 02ccf1ef9b
7 changed files with 34 additions and 9 deletions

View File

@ -20,7 +20,6 @@ import (
"fmt"
"io/ioutil"
"net"
"os"
"runtime"
"syscall"
@ -415,9 +414,7 @@ func cmdAdd(args *skel.CmdArgs) error {
// release IP in case of failure
defer func() {
if !success {
os.Setenv("CNI_COMMAND", "DEL")
ipam.ExecDel(n.IPAM.Type, args.StdinData)
os.Setenv("CNI_COMMAND", "ADD")
}
}()