Skip to content

Commit

Permalink
fix: suspend job status can not turn into Suspended and report error …
Browse files Browse the repository at this point in the history
…"job completion time is nil, cannot cleanup"

Signed-off-by: xuxianzhang <xuxianzhang@jd.com>
  • Loading branch information
xuxianzhang committed Jul 6, 2024
1 parent 2b39d3c commit ec888fb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/controller.v1/common/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,11 @@ func (jc *JobController) CleanUpResources(
jc.Recorder.Eventf(runtimeObject, corev1.EventTypeNormal, "SuccessfulDeletePodGroup", "Deleted PodGroup: %v", metaObject.GetName())
}
}
if err := jc.CleanupJob(runPolicy, jobStatus, runtimeObject); err != nil {
return err

if !trainutil.IsJobSuspended(runPolicy) {
if err := jc.CleanupJob(runPolicy, jobStatus, runtimeObject); err != nil {
return err
}
}
return nil
}
Expand Down

0 comments on commit ec888fb

Please sign in to comment.