Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
delete podgroup before clean job (#180)
Browse files Browse the repository at this point in the history
Signed-off-by: bert.li <[email protected]>
  • Loading branch information
qiankunli authored Nov 29, 2021
1 parent 1edc535 commit ba4c24a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/controller.v1/common/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ func (jc *JobController) ReconcileJobs(
return err
}

if err := jc.CleanupJob(runPolicy, jobStatus, job); err != nil {
return err
}

if jc.Config.EnableGangScheduling {
jc.Recorder.Event(runtimeObject, v1.EventTypeNormal, "JobTerminated", "Job has been terminated. Deleting PodGroup")
if err := jc.DeletePodGroup(metaObject); err != nil {
Expand All @@ -115,6 +111,10 @@ func (jc *JobController) ReconcileJobs(
}
}

if err := jc.CleanupJob(runPolicy, jobStatus, job); err != nil {
return err
}

// At this point the pods may have been deleted.
// 1) If the job succeeded, we manually set the replica status.
// 2) If any replicas are still active, set their status to succeeded.
Expand Down

0 comments on commit ba4c24a

Please sign in to comment.