Skip to content

Commit

Permalink
Merge pull request #527 from zrss/svc-mount
Browse files Browse the repository at this point in the history
Add svc hosts volumeMount for InitContainers
  • Loading branch information
volcano-sh-bot authored Nov 16, 2019
2 parents d88ac93 + 2fa949b commit 7e94a94
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pkg/controllers/job/plugins/svc/svc.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,17 @@ func (sp *servicePlugin) mountConfigmap(pod *v1.Pod, job *batch.Job) {
}
pod.Spec.Volumes = append(pod.Spec.Volumes, cmVolume)

for i, c := range pod.Spec.Containers {
vm := v1.VolumeMount{
MountPath: ConfigMapMountPath,
Name: cmName,
}
vm := v1.VolumeMount{
MountPath: ConfigMapMountPath,
Name: cmName,
}

for i, c := range pod.Spec.Containers {
pod.Spec.Containers[i].VolumeMounts = append(c.VolumeMounts, vm)
}
for i, c := range pod.Spec.InitContainers {
pod.Spec.InitContainers[i].VolumeMounts = append(c.VolumeMounts, vm)
}
}

func (sp *servicePlugin) createServiceIfNotExist(job *batch.Job) error {
Expand Down

0 comments on commit 7e94a94

Please sign in to comment.