csi: change the fsgrouppolicy for CephFS driver to "File" mode

At present the CephFS CSI driver works with default mode ie,
`ReadWriteOncewithFsType`. However `File` type is more apt for
the CephFS CSI driver and this commit bring that change. The
similar change is also introduced in ceph csi driver here:

https://github.com/ceph/ceph-csi/pull/3204

considering the `File` mode has been GAd in 1.23 kubernetes version
and also we are lifting one of the problematic code path in this
area via Ceph CSI driver changes, it is good to move the
fsgrouppolicy to `File`.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
(cherry picked from commit 58a2f66411)
This commit is contained in:
Humble Chirammal authored and Mergify committed 2022-08-23 19:01:44 +00:00
1 parent bcdc7eeb40
commit 096f0fe0e5
4 files changed
+8 -3

No files matched your search

+5
View File
@@ -52,6 +52,11 @@ func (d beta1CsiDriver) createCSIDriverInfo(ctx context.Context, clientset kuber
},
}
if fsGroupPolicy != "" {
if fsGroupPolicy == "File" {
// fsGroupPolicy: File was added in Kubernetes 1.19, considering beta1CsiDriver
// life exist before 1.19, we are falling back to `ReadWriteOnceWithFStype`.
fsGroupPolicy = "ReadWriteOnceWithFSType"
}
policy := betav1k8scsi.FSGroupPolicy(fsGroupPolicy)
csiDriver.Spec.FSGroupPolicy = &policy
}