Merge branch '2.5'
This commit is contained in:
commit
802ede1cd3
1 file changed
+7
@@ -6,6 +6,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/containernetworking/cni/pkg/ipam"
|
"github.com/containernetworking/cni/pkg/ipam"
|
||||||
"github.com/containernetworking/cni/pkg/skel"
|
"github.com/containernetworking/cni/pkg/skel"
|
||||||
@@ -206,7 +207,13 @@ func (c *CNIPlugin) CmdDel(args *skel.CmdArgs) error {
|
|||||||
err = ipam.ExecDel(conf.IPAM.Type, args.StdinData)
|
err = ipam.ExecDel(conf.IPAM.Type, args.StdinData)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if strings.Contains(err.Error(), fmt.Sprintf("Delete: no addresses for %s", args.ContainerID)) {
|
||||||
|
// ignore the error in the case where there are no IP addresses associated with container
|
||||||
|
fmt.Fprintln(os.Stderr, "weave-cni:", fmt.Sprintf("Delete: no addresses for %s", args.ContainerID))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
logOnStderr(fmt.Errorf("unable to release IP address: %s", err))
|
logOnStderr(fmt.Errorf("unable to release IP address: %s", err))
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user