mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Merge pull request #44483 from FengyunPan/ignore-notFound2
Automatic merge from submit-queue Ignore IsNotFound error IsNotFound error is fine since that means the object is deleted already, so we should check err and ignore err before returning.
This commit is contained in:
commit
9bce5f01c8
@ -33,6 +33,7 @@ go_library(
|
||||
"//pkg/client/clientset_generated/internalclientset:go_default_library",
|
||||
"//pkg/controller/deployment/util:go_default_library",
|
||||
"//vendor/github.com/golang/glog:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library",
|
||||
|
@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
pkgruntime "k8s.io/apimachinery/pkg/runtime"
|
||||
kubeclientset "k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
|
||||
)
|
||||
@ -95,6 +96,10 @@ func (fu *federatedUpdaterImpl) UpdateWithOnError(ops []FederatedOperation, time
|
||||
err = fu.updateFunction(clientset, op.Obj)
|
||||
case OperationTypeDelete:
|
||||
err = fu.deleteFunction(clientset, op.Obj)
|
||||
// IsNotFound error is fine since that means the object is deleted already.
|
||||
if errors.IsNotFound(err) {
|
||||
err = nil
|
||||
}
|
||||
}
|
||||
if err != nil && onError != nil {
|
||||
onError(op, err)
|
||||
|
Loading…
Reference in New Issue
Block a user