Mount ufs volumes according to datasets' accessModes (#3634)
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
This commit is contained in:
parent
f61c3d3aae
commit
25212a06d3
|
@ -303,11 +303,17 @@ func (e *JindoCacheEngine) transformMaster(runtime *datav1alpha1.JindoRuntime, m
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default to mount ufs volumes in read-only mode. Mount in read-write mode only when
|
// Default to mount ufs volumes in read-only mode. Mount in read-write mode only when
|
||||||
// the dataset is set to ReadWriteMany explicitly.
|
// the dataset's accessMode is set explicitly.
|
||||||
ufsVolumeReadOnly := true
|
ufsVolumeReadOnly := false
|
||||||
accessModes := dataset.Spec.AccessModes
|
accessModes := dataset.Spec.AccessModes
|
||||||
if len(accessModes) == 1 && accessModes[0] == corev1.ReadWriteMany {
|
if len(accessModes) == 0 {
|
||||||
ufsVolumeReadOnly = false
|
ufsVolumeReadOnly = true
|
||||||
|
} else {
|
||||||
|
for _, mode := range accessModes {
|
||||||
|
if mode == corev1.ReadOnlyMany {
|
||||||
|
ufsVolumeReadOnly = true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Split MountPoint into PVC name and subpath (if it contains a subpath)
|
// Split MountPoint into PVC name and subpath (if it contains a subpath)
|
||||||
|
|
|
@ -257,11 +257,17 @@ func (e *JindoFSxEngine) transformMaster(runtime *datav1alpha1.JindoRuntime, met
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default to mount ufs volumes in read-only mode. Mount in read-write mode only when
|
// Default to mount ufs volumes in read-only mode. Mount in read-write mode only when
|
||||||
// the dataset is set to ReadWriteMany explicitly.
|
// the dataset's accessMode is set explicitly.
|
||||||
ufsVolumeReadOnly := true
|
ufsVolumeReadOnly := false
|
||||||
accessModes := dataset.Spec.AccessModes
|
accessModes := dataset.Spec.AccessModes
|
||||||
if len(accessModes) == 1 && accessModes[0] == corev1.ReadWriteMany {
|
if len(accessModes) == 0 {
|
||||||
ufsVolumeReadOnly = false
|
ufsVolumeReadOnly = true
|
||||||
|
} else {
|
||||||
|
for _, mode := range accessModes {
|
||||||
|
if mode == corev1.ReadOnlyMany {
|
||||||
|
ufsVolumeReadOnly = true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Split MountPoint into PVC name and subpath (if it contains a subpath)
|
// Split MountPoint into PVC name and subpath (if it contains a subpath)
|
||||||
|
|
Loading…
Reference in New Issue