Skip to content

Commit 8202b79

Browse files
committed
Job: Use jobSuspended util for suspended detection
Signed-off-by: Yuki Iwai <[email protected]>
1 parent 9d9e1af commit 8202b79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/controller/job/job_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ func (jm *Controller) syncJob(ctx context.Context, key string) (rErr error) {
10071007
// Update the conditions / emit events only if manageJob was called in
10081008
// this syncJob. Otherwise wait for the right syncJob call to make
10091009
// updates.
1010-
if job.Spec.Suspend != nil && *job.Spec.Suspend {
1010+
if jobSuspended(&job) {
10111011
// Job can be in the suspended state only if it is NOT completed.
10121012
var isUpdated bool
10131013
job.Status.Conditions, isUpdated = ensureJobConditionStatus(job.Status.Conditions, batch.JobSuspended, v1.ConditionTrue, "JobSuspended", "Job suspended", jm.clock.Now())

0 commit comments

Comments
 (0)