mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-09-18 16:00:04 +00:00
fixing the cmddel fix code
This commit is contained in:
committed by
Kuralamudhan Ramakrishnan
parent
b01f784504
commit
f0f1d506c4
@@ -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()
|
||||
|
||||
|
Reference in New Issue
Block a user