diff --git a/charts/ceph-csi-cephfs/README.md b/charts/ceph-csi-cephfs/README.md index 3de32168778..5ee44bde0fb 100644 --- a/charts/ceph-csi-cephfs/README.md +++ b/charts/ceph-csi-cephfs/README.md @@ -196,6 +196,8 @@ charts and their default values. | `secret.adminID` | Specifies the admin ID of the cephFS secret | `` | | `secret.adminKey` | Specifies the key that corresponds to the adminID | `<Ceph auth key corresponding to ID above>` | | `selinuxMount` | Mount the host /etc/selinux inside pods to support selinux-enabled filesystems | `true` | +| `CSIDriver.fsGroupPolicy` | Specifies the fsGroupPolicy for the CSI driver object | `File` | +| `CSIDriver.seLinuxMount` | Specify for efficient SELinux volume relabeling | `true` | ### Command Line diff --git a/charts/ceph-csi-cephfs/templates/csidriver-crd.yaml b/charts/ceph-csi-cephfs/templates/csidriver-crd.yaml index 5aacbe271ab..821bd19251e 100644 --- a/charts/ceph-csi-cephfs/templates/csidriver-crd.yaml +++ b/charts/ceph-csi-cephfs/templates/csidriver-crd.yaml @@ -12,6 +12,6 @@ spec: attachRequired: false podInfoOnMount: false fsGroupPolicy: {{ .Values.CSIDriver.fsGroupPolicy }} -{{- if and (semverCompare ">= 1.25.x" .Capabilities.KubeVersion.Version) .Values.seLinuxMount }} +{{- if and (semverCompare ">= 1.25.x" .Capabilities.KubeVersion.Version) .Values.CSIDriver.seLinuxMount }} seLinuxMount: true {{- end }} diff --git a/charts/ceph-csi-rbd/README.md b/charts/ceph-csi-rbd/README.md index 6ab8b7a36c2..def55d6f4f4 100644 --- a/charts/ceph-csi-rbd/README.md +++ b/charts/ceph-csi-rbd/README.md @@ -225,6 +225,8 @@ charts and their default values. | `secret.userKey` | Specifies the key that corresponds to the userID | `<Ceph auth key corresponding to ID above>` | | `secret.encryptionPassphrase` | Specifies the encryption passphrase of the secret | `test_passphrase` | | `selinuxMount` | Mount the host /etc/selinux inside pods to support selinux-enabled filesystems | `true` | +| `CSIDriver.fsGroupPolicy` | Specifies the fsGroupPolicy for the CSI driver object | `File` | +| `CSIDriver.seLinuxMount` | Specify for efficient SELinux volume relabeling | `true` | ### Command Line diff --git a/charts/ceph-csi-rbd/templates/csidriver-crd.yaml b/charts/ceph-csi-rbd/templates/csidriver-crd.yaml index d1524527e0f..f3f1b2e0872 100644 --- a/charts/ceph-csi-rbd/templates/csidriver-crd.yaml +++ b/charts/ceph-csi-rbd/templates/csidriver-crd.yaml @@ -12,6 +12,6 @@ spec: attachRequired: true podInfoOnMount: false fsGroupPolicy: {{ .Values.CSIDriver.fsGroupPolicy }} -{{- if and (semverCompare ">= 1.25.x" .Capabilities.KubeVersion.Version) .Values.seLinuxMount }} +{{- if and (semverCompare ">= 1.25.x" .Capabilities.KubeVersion.Version) .Values.CSIDriver.seLinuxMount }} seLinuxMount: true {{- end }} diff --git a/internal/cephfs/groupcontrollerserver.go b/internal/cephfs/groupcontrollerserver.go index 42ab7aec11d..2e2a5b7d676 100644 --- a/internal/cephfs/groupcontrollerserver.go +++ b/internal/cephfs/groupcontrollerserver.go @@ -20,6 +20,7 @@ import ( "context" "errors" "fmt" + "slices" "sort" "time" @@ -36,7 +37,6 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" - "k8s.io/utils/strings/slices" ) // validateCreateVolumeGroupSnapshotRequest validates the request for creating