fix: make ro and rw mounts for one same nqn possible in a single node

ReadOnly and ReadWrite mounts for one same nqn in a single node return -EBUSY error.
So, we should remove readonly and readwrite options when mounting a block device in a
csi driver. A cri runtime makes a mount as readonly inside containers if needed.
This commit is contained in:
haruband
2023-04-05 12:42:54 +09:00
parent beb4cc9ea0
commit a0c8d015f6

View File

@@ -142,11 +142,6 @@ func AttachDisk(req *csi.NodePublishVolumeRequest, nm nvmfDiskMounter) (string,
// Tips: use k8s mounter to mount fs and only support "ext4"
var options []string
if nm.readOnly {
options = append(options, "ro")
} else {
options = append(options, "rw")
}
options = append(options, nm.mountOptions...)
err = nm.mounter.FormatAndMount(devicePath, mntPath, nm.fsType, options)
if err != nil {