Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
operator: mount /sys in case of direct mode
Browse files Browse the repository at this point in the history
Mounting /sys inside the driver container for direct mode was missing.

FIXES: #581
  • Loading branch information
avalluri committed Apr 12, 2020
1 parent 032fa07 commit 7cab808
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pkg/pmem-csi-operator/controller/deployment/controller_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ func (d *PmemCSIDriver) getControllerContainer() corev1.Container {
func (d *PmemCSIDriver) getNodeDriverContainer() corev1.Container {
bidirectional := corev1.MountPropagationBidirectional
true := true
return corev1.Container{
c := corev1.Container{
Name: "pmem-driver",
Image: d.Spec.Image,
ImagePullPolicy: d.Spec.PullPolicy,
Expand Down Expand Up @@ -937,6 +937,16 @@ func (d *PmemCSIDriver) getNodeDriverContainer() corev1.Container {
Privileged: &true,
},
}

// Driver in 'direct' mode requires /sys mounting
if d.Spec.DeviceMode == api.DeviceModeDirect {
c.VolumeMounts = append(c.VolumeMounts, corev1.VolumeMount{
Name: "sys-dir",
MountPath: "/sys",
})
}

return c
}

func (d *PmemCSIDriver) getProvisionerContainer() corev1.Container {
Expand Down

0 comments on commit 7cab808

Please sign in to comment.