Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 243a92a

Browse files
consideRatiofntlnz
authored andcommitted
fix: only define usr-host volume if to be mounted by a container
1 parent a02560d commit 243a92a

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

‎pkg/tracejob/job.go‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,6 @@ func (nj *TraceJob) Job() *batchv1.Job {
284284
},
285285
},
286286
},
287-
apiv1.Volume{
288-
Name: "usr-host",
289-
VolumeSource: apiv1.VolumeSource{
290-
HostPath: &apiv1.HostPathVolumeSource{
291-
Path: "/usr",
292-
},
293-
},
294-
},
295287
apiv1.Volume{
296288
Name: "modules-host",
297289
VolumeSource: apiv1.VolumeSource{
@@ -506,7 +498,17 @@ func (nj *TraceJob) Job() *batchv1.Job {
506498
})
507499

508500
} else {
509-
// If we aren't downloading headers, unconditionally used the ones linked in /lib/modules
501+
// If we aren't downloading headers, unconditionally use the ones linked in /lib/modules
502+
job.Spec.Template.Spec.Volumes = append(job.Spec.Template.Spec.Volumes,
503+
apiv1.Volume{
504+
Name: "usr-host",
505+
VolumeSource: apiv1.VolumeSource{
506+
HostPath: &apiv1.HostPathVolumeSource{
507+
Path: "/usr",
508+
},
509+
},
510+
})
511+
510512
job.Spec.Template.Spec.Containers[0].VolumeMounts = append(job.Spec.Template.Spec.Containers[0].VolumeMounts,
511513
apiv1.VolumeMount{
512514
Name: "usr-host",

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /