mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Job: Use jobSuspended util for suspended detection
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
This commit is contained in:
parent
9d9e1afdf7
commit
8202b791e9
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user