Skip to content

Commit cc959f7

Browse files
authored
Merge pull request #31 from Random-Liu/ignore-not-exit-error
Ignore "no such file or directory" error.
2 parents 7585e6d + a442970 commit cc959f7

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)