Rename IsRWOP

To be able to update content of the function to other access modes when we
implement SELinux mount for more of them.
This commit is contained in:
Jan Safranek
2022-07-29 10:38:51 +02:00
parent 1490d51028
commit a01e720a1a
3 changed files with 16 additions and 12 deletions

View File

@@ -166,10 +166,15 @@ func SupportsSELinuxContextMount(volumeSpec *volume.Spec, volumePluginMgr *volum
return false, nil
}
func IsRWOP(volumeSpec *volume.Spec) bool {
// VolumeSupportsSELinuxMount returns true if given volume access mode can support mount with SELinux mount options.
func VolumeSupportsSELinuxMount(volumeSpec *volume.Spec) bool {
// Right now, SELinux mount is supported only for ReadWriteOncePod volumes.
if !utilfeature.DefaultFeatureGate.Enabled(features.ReadWriteOncePod) {
return false
}
if !utilfeature.DefaultFeatureGate.Enabled(features.SELinuxMountReadWriteOncePod) {
return false
}
if volumeSpec.PersistentVolume == nil {
return false
}