mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Do not skip job requeue in conflict error
Change-Id: Ie97977887a1cc3de58922d73dce92ae1965965bf
This commit is contained in:
parent
3251d4cff6
commit
b492f49c9f
@ -537,12 +537,7 @@ func (jm *Controller) processNextWorkItem(ctx context.Context) bool {
|
||||
}
|
||||
|
||||
utilruntime.HandleError(fmt.Errorf("syncing job: %w", err))
|
||||
if !apierrors.IsConflict(err) {
|
||||
// If this was a conflict error, we expect a Job or Pod update event, which
|
||||
// will add the job back to the queue. Avoiding the rate limited requeue
|
||||
// saves an unnecessary sync.
|
||||
jm.queue.AddRateLimited(key)
|
||||
}
|
||||
jm.queue.AddRateLimited(key)
|
||||
|
||||
return true
|
||||
}
|
||||
|
@ -2007,11 +2007,13 @@ func TestSyncJobUpdateRequeue(t *testing.T) {
|
||||
wantRequeue: true,
|
||||
},
|
||||
"conflict error": {
|
||||
updateErr: apierrors.NewConflict(schema.GroupResource{}, "", nil),
|
||||
updateErr: apierrors.NewConflict(schema.GroupResource{}, "", nil),
|
||||
wantRequeue: true,
|
||||
},
|
||||
"conflict error, with finalizers": {
|
||||
withFinalizers: true,
|
||||
updateErr: apierrors.NewConflict(schema.GroupResource{}, "", nil),
|
||||
wantRequeue: true,
|
||||
},
|
||||
}
|
||||
for name, tc := range cases {
|
||||
|
Loading…
Reference in New Issue
Block a user