From 91167ebd01e6de2a634b0ca149b1304f637546ed Mon Sep 17 00:00:00 2001 From: Mark Mandel Date: Mon, 3 Feb 2020 20:03:43 -0800 Subject: [PATCH] Workerqueue IsConflixt needed to check error Cause (#1310) Because errors are often wrapped, when checking Kubernetes error types on anything other than errors comming straight from Kubernetes, we should be using `errors.Cause(err)` to find the root error. Otherwise, this check continues to passes down to the error handler, which defeated the purposes of the original fix. Co-authored-by: Robert Bailey --- pkg/util/workerqueue/workerqueue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/util/workerqueue/workerqueue.go b/pkg/util/workerqueue/workerqueue.go index 69462691e0..2d85e9d118 100644 --- a/pkg/util/workerqueue/workerqueue.go +++ b/pkg/util/workerqueue/workerqueue.go @@ -152,7 +152,7 @@ func (wq *WorkerQueue) processNextWorkItem() bool { if err := wq.SyncHandler(key); err != nil { // Conflicts are expected, so only show them in debug operations. - if k8serror.IsConflict(err) { + if k8serror.IsConflict(errors.Cause(err)) { wq.logger.WithField(wq.keyName, obj).Debug(err) } else { runtime.HandleError(wq.logger.WithField(wq.keyName, obj), err)