Merge pull request #103868 from qingsenLi/210723-forget

Merge conditional assignment into variable declaration
This commit is contained in:
Kubernetes Prow Robot 2021-10-28 16:32:50 -07:00 committed by GitHub
commit 8e37a3b324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -800,14 +800,11 @@ func (jm *Controller) syncJob(key string) (forget bool, rErr error) {
}
}
forget = false
// Check if the number of jobs succeeded increased since the last check. If yes "forget" should be true
// This logic is linked to the issue: https://github.com/kubernetes/kubernetes/issues/56853 that aims to
// improve the Job backoff policy when parallelism > 1 and few Jobs failed but others succeed.
// In this case, we should clear the backoff delay.
if job.Status.Succeeded < succeeded {
forget = true
}
forget = job.Status.Succeeded < succeeded
if uncounted != nil {
needsStatusUpdate := suspendCondChanged || active != job.Status.Active || !equalReady(ready, job.Status.Ready)