Skip to content

Commit

Permalink
Merge pull request volcano-sh#12 from k82cn/job_sched_name
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaus Ma authored Jan 27, 2019
2 parents c46351a + 3cfe9ce commit 0413ac4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion example/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: test-job
spec:
minAvailable: 3
schedulerName: kube-batch
policies:
- event: PodEvicted
action: RestartJob
Expand Down Expand Up @@ -31,4 +32,3 @@ spec:
requests:
cpu: "1"
restartPolicy: OnFailure
schedulerName: kube-batch
5 changes: 5 additions & 0 deletions pkg/controllers/job/job_controller_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ func createJobPod(job *vkv1.Job, template *v1.PodTemplateSpec, ix int) *v1.Pod {
Spec: templateCopy.Spec,
}

// If no scheduler name in Pod, use scheduler name from Job.
if len(pod.Spec.SchedulerName) == 0 {
pod.Spec.SchedulerName = job.Spec.SchedulerName
}

if job.Spec.Output != nil {
if job.Spec.Output.VolumeClaim == nil {
volume := v1.Volume{
Expand Down

0 comments on commit 0413ac4

Please sign in to comment.