Skip to content

Commit

Permalink
Merge pull request #31 from Random-Liu/ignore-not-exit-error
Browse files Browse the repository at this point in the history
Ignore "no such file or directory" error.
  • Loading branch information
abhi committed Oct 10, 2018
2 parents 7585e6d + a442970 commit cc959f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package cni

import (
"fmt"
"strings"
"sync"

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

0 comments on commit cc959f7

Please sign in to comment.