Skip to content
Permalink
Browse files

fixing the cmddel fix code

  • Loading branch information...
rkamudhan committed Aug 16, 2018
1 parent b01f784 commit f0f1d506c41a84b3e752402500522ff10a355b41
Showing with 7 additions and 9 deletions.
  1. +7 −9 multus/multus.go
@@ -313,16 +313,14 @@ func cmdDel(args *skel.CmdArgs, exec invoke.Exec, kubeClient k8s.KubeClient) err
}
netns, err := ns.GetNS(args.Netns)
if err != nil {
if err != nil {
// if NetNs is passed down by the CEO, or if it called multiple times
// so don't return an error if the device is already removed.
// https://github.com/kubernetes/kubernetes/issues/43014#issuecomment-287164444
_, ok := err.(ns.NSPathNotExistErr)
if ok {
return nil
}
return fmt.Errorf("failed to open netns %q: %v", netns, err)
// if NetNs is passed down by the Cloud Orchestration Engine, or if it called multiple times
// so don't return an error if the device is already removed.
// https://github.com/kubernetes/kubernetes/issues/43014#issuecomment-287164444
_, ok := err.(ns.NSPathNotExistErr)
if ok {
return nil
}
return fmt.Errorf("failed to open netns %q: %v", netns, err)
}
defer netns.Close()

0 comments on commit f0f1d50

Please sign in to comment.
You can’t perform that action at this time.