forked from rook/rook
Merge pull request #10503 from humblec/cephfs-file-policy
csi: change the fsgrouppolicy for CephFS driver to "File" mode
This commit is contained in:
@@ -85,7 +85,7 @@ csi:
|
||||
|
||||
# (Optional) policy for modifying a volume's ownership or permissions when the CephFS PVC is being mounted.
|
||||
# supported values are documented at https://kubernetes-csi.github.io/docs/support-fsgroup.html
|
||||
cephFSFSGroupPolicy: "ReadWriteOnceWithFSType"
|
||||
cephFSFSGroupPolicy: "File"
|
||||
|
||||
# (Optional) policy for modifying a volume's ownership or permissions when the NFS PVC is being mounted.
|
||||
# supported values are documented at https://kubernetes-csi.github.io/docs/support-fsgroup.html
|
||||
|
||||
@@ -162,7 +162,7 @@ data:
|
||||
|
||||
# (Optional) policy for modifying a volume's ownership or permissions when the CephFS PVC is being mounted.
|
||||
# supported values are documented at https://kubernetes-csi.github.io/docs/support-fsgroup.html
|
||||
CSI_CEPHFS_FSGROUPPOLICY: "ReadWriteOnceWithFSType"
|
||||
CSI_CEPHFS_FSGROUPPOLICY: "File"
|
||||
|
||||
# (Optional) policy for modifying a volume's ownership or permissions when the NFS PVC is being mounted.
|
||||
# supported values are documented at https://kubernetes-csi.github.io/docs/support-fsgroup.html
|
||||
|
||||
@@ -77,7 +77,7 @@ data:
|
||||
|
||||
# (Optional) policy for modifying a volume's ownership or permissions when the CephFS PVC is being mounted.
|
||||
# supported values are documented at https://kubernetes-csi.github.io/docs/support-fsgroup.html
|
||||
CSI_CEPHFS_FSGROUPPOLICY: "ReadWriteOnceWithFSType"
|
||||
CSI_CEPHFS_FSGROUPPOLICY: "File"
|
||||
|
||||
# (Optional) policy for modifying a volume's ownership or permissions when the NFS PVC is being mounted.
|
||||
# supported values are documented at https://kubernetes-csi.github.io/docs/support-fsgroup.html
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user