Signed-off-by: silenceper <silenceper@gmail.com>
This commit is contained in:
silenceper 2022-01-06 20:56:49 +08:00
parent cc32993e9e
commit 67110e02ba
No known key found for this signature in database
GPG Key ID: 80FB07C5C9C82ECC
7 changed files with 66 additions and 1 deletions

View File

@ -672,6 +672,13 @@ func cmdDel(args *skel.CmdArgs) error {
})
if err != nil {
// 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 err
}

View File

@ -310,6 +310,17 @@ func cmdDel(args *skel.CmdArgs) error {
return nil
})
if err != nil {
// 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 err
}
return err
}

View File

@ -159,7 +159,14 @@ func cmdDel(args *skel.CmdArgs) error {
return nil
})
if err != nil {
return err // not tested
// 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 err
}
return nil

View File

@ -367,6 +367,17 @@ func cmdDel(args *skel.CmdArgs) error {
return nil
})
if err != nil {
// 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 err
}
return err
}

View File

@ -292,6 +292,13 @@ func cmdDel(args *skel.CmdArgs) error {
})
if err != nil {
// 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 err
}

View File

@ -213,6 +213,17 @@ func cmdDel(args *skel.CmdArgs) error {
return err
})
if err != nil {
// 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 err
}
return err
}

View File

@ -123,6 +123,17 @@ func cmdDel(args *skel.CmdArgs) error {
return nil
})
if err != nil {
// 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 err
}
if err != nil {
return fmt.Errorf("cmdDel failed: %v", err)
}