Skip to content

Commit aa8bf14

Browse files
authored
Merge pull request #74 from claudiubelu/remove-not-found
remove: Continue on "not found" errors
2 parents fe8eec9 + eff9f5b commit aa8bf14

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cni.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ func (c *libcni) Remove(ctx context.Context, id string, path string, opts ...Nam
183183
// https://github.com/containernetworking/plugins/issues/210
184184
// TODO(random-liu): Remove the error handling when the issue is
185185
// fixed and the CNI spec v0.6.0 support is deprecated.
186-
if path == "" && strings.Contains(err.Error(), "no such file or directory") {
186+
// NOTE(claudiub): Some CNIs could return a "not found" error, which could mean that
187+
// it was already deleted.
188+
if (path == "" && strings.Contains(err.Error(), "no such file or directory")) || strings.Contains(err.Error(), "not found") {
187189
continue
188190
}
189191
return err

0 commit comments

Comments
 (0)