mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 14:30:12 +01:00
fix(readonly): honouring readonly flag.
Readonly flag does not come as mount option, it has separate field to mention readonly flag. ZFS-LocalPV driver should check that field and add "ro" as mountoption. Signed-off-by: Pawan <pawan@mayadata.io>
This commit is contained in:
parent
d47ec3ba01
commit
42ed7d85ee
2 changed files with 4 additions and 5 deletions
|
|
@ -57,10 +57,6 @@ type MountInfo struct {
|
||||||
// on that node
|
// on that node
|
||||||
MountPath string `json:"mountPath"`
|
MountPath string `json:"mountPath"`
|
||||||
|
|
||||||
// ReadOnly specifies if the volume needs
|
|
||||||
// to be mounted in ReadOnly mode
|
|
||||||
ReadOnly bool `json:"readOnly"`
|
|
||||||
|
|
||||||
// MountOptions specifies the options with
|
// MountOptions specifies the options with
|
||||||
// which mount needs to be attempted
|
// which mount needs to be attempted
|
||||||
MountOptions []string `json:"mountOptions"`
|
MountOptions []string `json:"mountOptions"`
|
||||||
|
|
|
||||||
|
|
@ -76,9 +76,12 @@ func GetVolAndMountInfo(
|
||||||
|
|
||||||
mountinfo.FSType = req.GetVolumeCapability().GetMount().GetFsType()
|
mountinfo.FSType = req.GetVolumeCapability().GetMount().GetFsType()
|
||||||
mountinfo.MountPath = req.GetTargetPath()
|
mountinfo.MountPath = req.GetTargetPath()
|
||||||
mountinfo.ReadOnly = req.GetReadonly()
|
|
||||||
mountinfo.MountOptions = append(mountinfo.MountOptions, req.GetVolumeCapability().GetMount().GetMountFlags()...)
|
mountinfo.MountOptions = append(mountinfo.MountOptions, req.GetVolumeCapability().GetMount().GetMountFlags()...)
|
||||||
|
|
||||||
|
if req.GetReadonly() {
|
||||||
|
mountinfo.MountOptions = append(mountinfo.MountOptions, "ro")
|
||||||
|
}
|
||||||
|
|
||||||
getOptions := metav1.GetOptions{}
|
getOptions := metav1.GetOptions{}
|
||||||
vol, err := volbuilder.NewKubeclient().
|
vol, err := volbuilder.NewKubeclient().
|
||||||
WithNamespace(zfs.OpenEBSNamespace).
|
WithNamespace(zfs.OpenEBSNamespace).
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue