mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-13 10:50:56 -04:00
Do not skip job requeue in conflict error
Change-Id: Ie97977887a1cc3de58922d73dce92ae1965965bf
This commit is contained in:
parent
01f80aefeb
commit
71a4c69a21
2 changed files with 4 additions and 7 deletions
|
|
@ -531,12 +531,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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1997,11 +1997,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 a new issue