From 8202b791e9638fbf3a62ab694731e35b1095c655 Mon Sep 17 00:00:00 2001 From: Yuki Iwai Date: Wed, 5 Mar 2025 18:12:59 +0900 Subject: [PATCH] Job: Use jobSuspended util for suspended detection Signed-off-by: Yuki Iwai --- pkg/controller/job/job_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/job/job_controller.go b/pkg/controller/job/job_controller.go index 2a811639d7f..c7849b8ccb4 100644 --- a/pkg/controller/job/job_controller.go +++ b/pkg/controller/job/job_controller.go @@ -1007,7 +1007,7 @@ func (jm *Controller) syncJob(ctx context.Context, key string) (rErr error) { // Update the conditions / emit events only if manageJob was called in // this syncJob. Otherwise wait for the right syncJob call to make // updates. - if job.Spec.Suspend != nil && *job.Spec.Suspend { + if jobSuspended(&job) { // Job can be in the suspended state only if it is NOT completed. var isUpdated bool job.Status.Conditions, isUpdated = ensureJobConditionStatus(job.Status.Conditions, batch.JobSuspended, v1.ConditionTrue, "JobSuspended", "Job suspended", jm.clock.Now())