From 2740965dc9c7b78c1af8e5b334f96dd5cce441f7 Mon Sep 17 00:00:00 2001
From: 10177505
Date: Fri, 23 Jul 2021 17:02:19 +0800
Subject: [PATCH] Merge conditional assignment into variable declaration
---
pkg/controller/job/job_controller.go | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/pkg/controller/job/job_controller.go b/pkg/controller/job/job_controller.go
index 1a00f6b7e21..9a2219f5a0e 100644
--- a/pkg/controller/job/job_controller.go
+++ b/pkg/controller/job/job_controller.go
@@ -740,14 +740,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