From a80396df1bf30e58acbebf7fd66eef0741f7bc4d Mon Sep 17 00:00:00 2001 From: Praveen M Date: Thu, 23 Nov 2023 13:10:02 +0530 Subject: [PATCH] csi: update cmdline args as used by ceph-csi This commit adds cmdline args to enable 1. RecoverVolumeExpansionFailure 2. PreventVolumeModeConversion 3. HonorPVReclaimPolicy Signed-off-by: Praveen M --- deploy/charts/rook-ceph/templates/clusterrole.yaml | 6 +++--- deploy/examples/common.yaml | 4 ++-- deploy/examples/csi/nfs/rbac.yaml | 2 +- .../template/cephfs/csi-cephfsplugin-provisioner-dep.yaml | 3 +++ .../csi/template/nfs/csi-nfsplugin-provisioner-dep.yaml | 3 +++ .../csi/template/rbd/csi-rbdplugin-provisioner-dep.yaml | 3 +++ tests/framework/utils/env.go | 2 +- 7 files changed, 16 insertions(+), 7 deletions(-) diff --git a/deploy/charts/rook-ceph/templates/clusterrole.yaml b/deploy/charts/rook-ceph/templates/clusterrole.yaml index 58430cd9b..a242aa643 100644 --- a/deploy/charts/rook-ceph/templates/clusterrole.yaml +++ b/deploy/charts/rook-ceph/templates/clusterrole.yaml @@ -406,7 +406,7 @@ metadata: rules: - apiGroups: [""] resources: ["persistentvolumes"] - verbs: ["get", "list", "watch", "create", "delete", "patch"] + verbs: ["get", "list", "watch", "create", "update", "delete", "patch"] - apiGroups: [""] resources: ["persistentvolumeclaims"] verbs: ["get", "list", "watch", "patch", "update"] @@ -479,7 +479,7 @@ rules: verbs: ["get", "list", "watch"] - apiGroups: [""] resources: ["persistentvolumes"] - verbs: ["get", "list", "watch", "create", "delete", "patch"] + verbs: ["get", "list", "watch", "create", "update", "delete", "patch"] - apiGroups: [""] resources: ["persistentvolumeclaims"] verbs: ["get", "list", "watch", "patch", "update"] @@ -552,7 +552,7 @@ rules: verbs: ["get", "list", "watch"] - apiGroups: [""] resources: ["persistentvolumes"] - verbs: ["get", "list", "watch", "create", "delete", "patch"] + verbs: ["get", "list", "watch", "create", "update", "delete", "patch"] - apiGroups: [""] resources: ["persistentvolumeclaims"] verbs: ["get", "list", "watch", "update"] diff --git a/deploy/examples/common.yaml b/deploy/examples/common.yaml index 565d6ce55..dcabb0eeb 100644 --- a/deploy/examples/common.yaml +++ b/deploy/examples/common.yaml @@ -33,7 +33,7 @@ rules: verbs: ["get", "list", "watch"] - apiGroups: [""] resources: ["persistentvolumes"] - verbs: ["get", "list", "watch", "create", "delete", "patch"] + verbs: ["get", "list", "watch", "create", "update", "delete", "patch"] - apiGroups: [""] resources: ["persistentvolumeclaims"] verbs: ["get", "list", "watch", "patch", "update"] @@ -125,7 +125,7 @@ rules: verbs: ["get", "list", "watch"] - apiGroups: [""] resources: ["persistentvolumes"] - verbs: ["get", "list", "watch", "create", "delete", "patch"] + verbs: ["get", "list", "watch", "create", "update", "delete", "patch"] - apiGroups: [""] resources: ["persistentvolumeclaims"] verbs: ["get", "list", "watch", "update"] diff --git a/deploy/examples/csi/nfs/rbac.yaml b/deploy/examples/csi/nfs/rbac.yaml index 029ec4458..7d459240e 100644 --- a/deploy/examples/csi/nfs/rbac.yaml +++ b/deploy/examples/csi/nfs/rbac.yaml @@ -24,7 +24,7 @@ metadata: rules: - apiGroups: [""] resources: ["persistentvolumes"] - verbs: ["get", "list", "watch", "create", "delete", "patch"] + verbs: ["get", "list", "watch", "create", "update", "delete", "patch"] - apiGroups: [""] resources: ["persistentvolumeclaims"] verbs: ["get", "list", "watch", "patch", "update"] diff --git a/pkg/operator/ceph/csi/template/cephfs/csi-cephfsplugin-provisioner-dep.yaml b/pkg/operator/ceph/csi/template/cephfs/csi-cephfsplugin-provisioner-dep.yaml index cdf5c9c51..af8400591 100644 --- a/pkg/operator/ceph/csi/template/cephfs/csi-cephfsplugin-provisioner-dep.yaml +++ b/pkg/operator/ceph/csi/template/cephfs/csi-cephfsplugin-provisioner-dep.yaml @@ -75,6 +75,7 @@ spec: - "--leader-election-renew-deadline=107s" - "--leader-election-retry-period=26s" - "--handle-volume-inuse-error=false" + - "--feature-gates=RecoverVolumeExpansionFailure=true" env: - name: ADDRESS value: unix:///csi/csi-provisioner.sock @@ -94,6 +95,8 @@ spec: - "--leader-election-lease-duration=137s" - "--leader-election-renew-deadline=107s" - "--leader-election-retry-period=26s" + - "--feature-gates=HonorPVReclaimPolicy=true" + - "--prevent-volume-mode-conversion=true" - "--extra-create-metadata=true" env: - name: ADDRESS diff --git a/pkg/operator/ceph/csi/template/nfs/csi-nfsplugin-provisioner-dep.yaml b/pkg/operator/ceph/csi/template/nfs/csi-nfsplugin-provisioner-dep.yaml index b8aeebda9..0dac5e48a 100644 --- a/pkg/operator/ceph/csi/template/nfs/csi-nfsplugin-provisioner-dep.yaml +++ b/pkg/operator/ceph/csi/template/nfs/csi-nfsplugin-provisioner-dep.yaml @@ -74,6 +74,7 @@ spec: - "--leader-election-renew-deadline=107s" - "--leader-election-retry-period=26s" - "--handle-volume-inuse-error=false" + - "--feature-gates=RecoverVolumeExpansionFailure=true" env: - name: ADDRESS value: unix:///csi/csi-provisioner.sock @@ -93,6 +94,8 @@ spec: - "--leader-election-lease-duration=137s" - "--leader-election-renew-deadline=107s" - "--leader-election-retry-period=26s" + - "--feature-gates=HonorPVReclaimPolicy=true" + - "--prevent-volume-mode-conversion=true" env: - name: ADDRESS value: unix:///csi/csi-provisioner.sock diff --git a/pkg/operator/ceph/csi/template/rbd/csi-rbdplugin-provisioner-dep.yaml b/pkg/operator/ceph/csi/template/rbd/csi-rbdplugin-provisioner-dep.yaml index 3abc84de1..5fbec1759 100644 --- a/pkg/operator/ceph/csi/template/rbd/csi-rbdplugin-provisioner-dep.yaml +++ b/pkg/operator/ceph/csi/template/rbd/csi-rbdplugin-provisioner-dep.yaml @@ -36,6 +36,8 @@ spec: - "--leader-election-retry-period=26s" - "--default-fstype=ext4" - "--extra-create-metadata=true" + - "--prevent-volume-mode-conversion=true" + - "--feature-gates=HonorPVReclaimPolicy=true" {{- if .EnableCSITopology }} - "--feature-gates=Topology=true" {{- end }} @@ -58,6 +60,7 @@ spec: - "--leader-election-renew-deadline=107s" - "--leader-election-retry-period=26s" - "--handle-volume-inuse-error=false" + - "--feature-gates=RecoverVolumeExpansionFailure=true" env: - name: ADDRESS value: unix:///csi/csi-provisioner.sock diff --git a/tests/framework/utils/env.go b/tests/framework/utils/env.go index 439bfc749..2cf3b4119 100644 --- a/tests/framework/utils/env.go +++ b/tests/framework/utils/env.go @@ -29,7 +29,7 @@ func TestEnvName() string { // TestRetryNumber get the max retry. Example, for OpenShift it's 40. func TestRetryNumber() int { - count := GetEnvVarWithDefault("RETRY_MAX", "45") + count := GetEnvVarWithDefault("RETRY_MAX", "55") number, err := strconv.Atoi(count) if err != nil { panic(fmt.Errorf("Error when converting to numeric value %v", err))