Skip to content

Commit

Permalink
Workerqueue IsConflixt needed to check error Cause (#1310)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
markmandel and roberthbailey authored Feb 4, 2020
1 parent be51a18 commit 91167eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/util/workerqueue/workerqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 91167eb

Please sign in to comment.