Update go-cni to 40bcf8ec8acd7372be1d77031d585d5d8e561c90.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2018-10-09 23:13:40 -07:00
parent c39f63eaf4
commit 1f1e92e4a4
2 changed files with 11 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ package cni
import (
"fmt"
"strings"
"sync"
cnilibrary "github.com/containernetworking/cni/libcni"
@@ -127,6 +128,15 @@ func (c *libcni) Remove(id string, path string, opts ...NamespaceOpts) error {
}
for _, network := range c.networks {
if err := network.Remove(ns); err != nil {
// Based on CNI spec v0.7.0, empty network namespace is allowed to
// do best effort cleanup. However, it is not handled consistently
// right now:
// https://github.com/containernetworking/plugins/issues/210
// TODO(random-liu): Remove the error handling when the issue is
// fixed and the CNI spec v0.6.0 support is deprecated.
if path == "" && strings.Contains(err.Error(), "no such file or directory") {
continue
}
return err
}
}