Skip to content

Commit 8f17246

Browse files
authored
fix: add security ctx for hypervisor init (#278)
1 parent ba21e5d commit 8f17246

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

internal/utils/compose.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,16 @@ func composeHypervisorInitContainer(spec *v1.PodSpec, pool *tfv1.GPUPool) {
351351
spec.InitContainers = append(spec.InitContainers, v1.Container{
352352
Name: "init-shm",
353353
Image: pool.Spec.ComponentConfig.Hypervisor.Image,
354-
Command: []string{"hypervisor", "mount-shm"},
354+
Command: []string{"./hypervisor", "mount-shm"},
355+
SecurityContext: &v1.SecurityContext{
356+
Privileged: ptr.To(true),
357+
},
355358
VolumeMounts: []v1.VolumeMount{
356359
{
357-
Name: constants.DataVolumeName,
358-
ReadOnly: false,
359-
MountPath: constants.TFDataPath,
360+
Name: constants.DataVolumeName,
361+
ReadOnly: false,
362+
MountPath: constants.TFDataPath,
363+
MountPropagation: ptr.To(v1.MountPropagationBidirectional),
360364
},
361365
},
362366
})

0 commit comments

Comments
 (0)