Skip to content

Commit

Permalink
Merge pull request kubeflow#9 from heluocs/feature/fix_clean_up_polic…
Browse files Browse the repository at this point in the history
…y_20220124

compatible for the mpijob which not specify clean pod policy
  • Loading branch information
cheyang authored Jan 24, 2022
2 parents 2423bdc + 7b09303 commit 05bf745
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/controllers/mpi_job_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,12 @@ func allocateGPUs(mpiJob *kubeflow.MPIJob, gpusPerNode int, done bool) (workerRe
}

if done {
if *mpiJob.Spec.CleanPodPolicy == kubeflow.CleanPodPolicyAll || *mpiJob.Spec.CleanPodPolicy == kubeflow.CleanPodPolicyRunning {
if mpiJob.Spec.CleanPodPolicy != nil {
if *mpiJob.Spec.CleanPodPolicy == kubeflow.CleanPodPolicyAll || *mpiJob.Spec.CleanPodPolicy == kubeflow.CleanPodPolicyRunning {
workerReplicas = 0
}
} else {
// compatible for the mpijob which not specify clean pod policy
workerReplicas = 0
}
}
Expand Down

0 comments on commit 05bf745

Please sign in to comment.