Skip to content

Commit a442970

Browse files
committed
Ignore "no such file or directory" error.
Signed-off-by: Lantao Liu <[email protected]>
1 parent 7585e6d commit a442970

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cni.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package cni
1818

1919
import (
2020
"fmt"
21+
"strings"
2122
"sync"
2223

2324
cnilibrary "github.com/containernetworking/cni/libcni"
@@ -126,7 +127,7 @@ func (c *libcni) Remove(id string, path string, opts ...NamespaceOpts) error {
126127
return err
127128
}
128129
for _, network := range c.networks {
129-
if err := network.Remove(ns); err != nil {
130+
if err := network.Remove(ns); err != nil && !strings.Contains(err.Error(), "no such file or directory") {
130131
return err
131132
}
132133
}

0 commit comments

Comments
 (0)