Skip to content

Commit

Permalink
Merge pull request #77 from joestringer/mount-usr-src
Browse files Browse the repository at this point in the history
fix: Mount /usr/src in pod template
  • Loading branch information
fntlnz committed Aug 15, 2019
2 parents 84e4f0c + 6be420a commit 82e3597
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/tracejob/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ func (t *TraceJobClient) CreateJob(nj TraceJob) (*batchv1.Job, error) {
},
},
},
apiv1.Volume{
Name: "usr-src-host",
VolumeSource: apiv1.VolumeSource{
HostPath: &apiv1.HostPathVolumeSource{
Path: "/usr/src",
},
},
},
apiv1.Volume{
Name: "modules-host",
VolumeSource: apiv1.VolumeSource{
Expand Down Expand Up @@ -409,6 +417,11 @@ func (t *TraceJobClient) CreateJob(nj TraceJob) (*batchv1.Job, error) {
} else {
// If we aren't downloading headers, unconditionally used the ones linked in /lib/modules
job.Spec.Template.Spec.Containers[0].VolumeMounts = append(job.Spec.Template.Spec.Containers[0].VolumeMounts,
apiv1.VolumeMount{
Name: "usr-src-host",
MountPath: "/usr/src",
ReadOnly: true,
},
apiv1.VolumeMount{
Name: "modules-host",
MountPath: "/lib/modules",
Expand Down

0 comments on commit 82e3597

Please sign in to comment.