From 1ab6390b26a9a890cfbf27a4f4c0c38d2c35cd85 Mon Sep 17 00:00:00 2001 From: Yuki Iwai Date: Wed, 12 Jul 2023 00:31:41 +0900 Subject: [PATCH] Remove a redundant condition check Signed-off-by: Yuki Iwai --- pkg/controller.v1/common/job.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/controller.v1/common/job.go b/pkg/controller.v1/common/job.go index 35a3e4e2f2..589bd82f03 100644 --- a/pkg/controller.v1/common/job.go +++ b/pkg/controller.v1/common/job.go @@ -150,7 +150,7 @@ func (jc *JobController) ReconcileJobs( jobStatus.ReplicaStatuses[rType].Active = 0 } jobStatus.StartTime = nil - msg := fmt.Sprintf("%s %s is suspended.", jc.Controller.GetAPIGroupVersionKind().Kind, jobName) + msg := fmt.Sprintf("%s %s is suspended.", jobKind, jobName) if commonutil.IsRunning(jobStatus) { if err = commonutil.UpdateJobConditions(&jobStatus, apiv1.JobRunning, corev1.ConditionFalse, commonutil.NewReason(jobKind, commonutil.JobSuspendedReason), msg); err != nil { @@ -167,8 +167,8 @@ func (jc *JobController) ReconcileJobs( } return nil } - if !trainutil.IsJobSuspended(runPolicy) && commonutil.IsSuspend(jobStatus) { - msg := fmt.Sprintf("%s %s is resumed.", jc.Controller.GetAPIGroupVersionKind().Kind, jobName) + if commonutil.IsSuspend(jobStatus) { + msg := fmt.Sprintf("%s %s is resumed.", jobKind, jobName) if err = commonutil.UpdateJobConditions(&jobStatus, apiv1.JobSuspended, corev1.ConditionFalse, commonutil.NewReason(jobKind, commonutil.JobResumedReason), msg); err != nil { return err