Repository: rook/rook
Pull request #14942 (2024-10-30 20:05:41)

csi: Remove version check for k8s and cephcsi
The version checks for the csi driver are removed now since they are all obsolete. The K8s version and cephcsi versions are no longer checked. Anyway, the move to the csi operator would take ownership of version checks needed in the future, so for now we simplify rook deployment of the csi driver.

We had some discussion about making this change recently with the csi team, though I'm not finding it in an issue.

This is done now to simplify #14941 so there won't be a need to unnecessarily set the resources on the csi detection job. 

<!-- Thank you for contributing to Rook! -->

<!-- STEPS TO FOLLOW:
  1. Add a description of the changes (frequently the same as the commit description)
  2. Enter the issue number next to "Resolves #" below (if there is no tracking issue resolved, **remove that section**)
  3. Review our Contributing documentation at https://rook.io/docs/rook/latest/Contributing/development-flow/
  4. Follow the steps in the checklist below, starting with the **Commit Message Formatting**.
-->

<!-- Uncomment this section with the issue number if an issue is being resolved
**Issue resolved by this Pull Request:**
Resolves #
--->

**Checklist:**

- [ ] **Commit Message Formatting**: Commit titles and messages follow guidelines in the [developer guide](https://rook.io/docs/rook/latest/Contributing/development-flow/#commit-structure).
- [ ] Reviewed the developer guide on [Submitting a Pull Request](https://rook.io/docs/rook/latest/Contributing/development-flow/#submitting-a-pull-request)
- [ ] [Pending release notes](https://github.com/rook/rook/blob/master/PendingReleaseNotes.md) updated with breaking and/or notable changes for the next minor release.
- [ ] Documentation has been updated, if necessary.
- [ ] Unit tests have been added, if necessary.
- [ ] Integration tests have been added, if necessary.



Patch:
diff --git a/Documentation/Helm-Charts/operator-chart.md b/Documentation/Helm-Charts/operator-chart.md
index 63ec4f542..7fc7ec887 100644
--- a/Documentation/Helm-Charts/operator-chart.md
+++ b/Documentation/Helm-Charts/operator-chart.md
@@ -52,7 +52,6 @@ The following table lists the configurable parameters of the rook-operator chart
 | `cephCommandsTimeoutSeconds` | The timeout for ceph commands in seconds | `"15"` |
 | `containerSecurityContext` | Set the container security context for the operator | `{"capabilities":{"drop":["ALL"]},"runAsGroup":2016,"runAsNonRoot":true,"runAsUser":2016}` |
 | `crds.enabled` | Whether the helm chart should create and update the CRDs. If false, the CRDs must be managed independently with deploy/examples/crds.yaml. **WARNING** Only set during first deployment. If later disabled the cluster may be DESTROYED. If the CRDs are deleted in this case, see [the disaster recovery guide](https://rook.io/docs/rook/latest/Troubleshooting/disaster-recovery/#restoring-crds-after-deletion) to restore them. | `true` |
-| `csi.allowUnsupportedVersion` | Allow starting an unsupported ceph-csi image | `false` |
 | `csi.attacher.repository` | Kubernetes CSI Attacher image repository | `"registry.k8s.io/sig-storage/csi-attacher"` |
 | `csi.attacher.tag` | Attacher image tag | `"v4.6.1"` |
 | `csi.cephFSAttachRequired` | Whether to skip any attach operation altogether for CephFS PVCs. See more details [here](https://kubernetes-csi.github.io/docs/skip-attach.html#skip-attach-with-csi-driver-object). If cephFSAttachRequired is set to false it skips the volume attachments and makes the creation of pods using the CephFS PVC fast. **WARNING** It's highly discouraged to use this for CephFS RWO volumes. Refer to this [issue](https://github.com/kubernetes/kubernetes/issues/103305) for more details. | `true` |
diff --git a/deploy/charts/rook-ceph/templates/configmap.yaml b/deploy/charts/rook-ceph/templates/configmap.yaml
index 98b99741d..1acc2c5e8 100644
--- a/deploy/charts/rook-ceph/templates/configmap.yaml
+++ b/deploy/charts/rook-ceph/templates/configmap.yaml
@@ -169,9 +169,6 @@ data:
 {{- if .Values.csi.nfsProvisionerNodeAffinity }}
   CSI_NFS_PROVISIONER_NODE_AFFINITY: {{ .Values.csi.nfsProvisionerNodeAffinity }}
 {{- end }}
-{{- if .Values.csi.allowUnsupportedVersion }}
-  ROOK_CSI_ALLOW_UNSUPPORTED_VERSION: {{ .Values.csi.allowUnsupportedVersion | quote }}
-{{- end }}
 {{- if .Values.csi.pluginTolerations }}
   CSI_PLUGIN_TOLERATIONS: {{ toYaml .Values.csi.pluginTolerations | quote }}
 {{- end }}
diff --git a/deploy/charts/rook-ceph/values.yaml b/deploy/charts/rook-ceph/values.yaml
index 5b48fc868..8b5ceb82f 100644
--- a/deploy/charts/rook-ceph/values.yaml
+++ b/deploy/charts/rook-ceph/values.yaml
@@ -179,9 +179,6 @@ csi:
   # -- Set GRPC timeout for csi containers (in seconds). It should be >= 120. If this value is not set or is invalid, it defaults to 150
   grpcTimeoutInSeconds: 150
 
-  # -- Allow starting an unsupported ceph-csi image
-  allowUnsupportedVersion: false
-
   # -- Burst to use while communicating with the kubernetes apiserver.
   kubeApiBurst:
 
diff --git a/deploy/examples/operator-openshift.yaml b/deploy/examples/operator-openshift.yaml
index 239b75b16..1186fd184 100644
--- a/deploy/examples/operator-openshift.yaml
+++ b/deploy/examples/operator-openshift.yaml
@@ -183,9 +183,6 @@ data:
   # supported values are documented at https://kubernetes-csi.github.io/docs/support-fsgroup.html
   CSI_NFS_FSGROUPPOLICY: "File"
 
-  # (Optional) Allow starting unsupported ceph-csi image
-  ROOK_CSI_ALLOW_UNSUPPORTED_VERSION: "false"
-
   # (Optional) control the host mount of /etc/selinux for csi plugin pods.
   CSI_PLUGIN_ENABLE_SELINUX_HOST_MOUNT: "false"
 
diff --git a/deploy/examples/operator.yaml b/deploy/examples/operator.yaml
index 1a90a5193..b11549be5 100644
--- a/deploy/examples/operator.yaml
+++ b/deploy/examples/operator.yaml
@@ -113,9 +113,6 @@ data:
   # supported values are documented at https://kubernetes-csi.github.io/docs/support-fsgroup.html
   CSI_NFS_FSGROUPPOLICY: "File"
 
-  # (Optional) Allow starting unsupported ceph-csi image
-  ROOK_CSI_ALLOW_UNSUPPORTED_VERSION: "false"
-
   # (Optional) control the host mount of /etc/selinux for csi plugin pods.
   CSI_PLUGIN_ENABLE_SELINUX_HOST_MOUNT: "false"
 
diff --git a/pkg/operator/ceph/csi/controller.go b/pkg/operator/ceph/csi/controller.go
index e2fc9e39f..b9c6c5034 100644
--- a/pkg/operator/ceph/csi/controller.go
+++ b/pkg/operator/ceph/csi/controller.go
@@ -43,7 +43,6 @@ import (
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/apimachinery/pkg/runtime"
 	"k8s.io/apimachinery/pkg/types"
-	"k8s.io/apimachinery/pkg/version"
 )
 
 const (
@@ -178,11 +177,6 @@ func (r *ReconcileCSI) reconcile(request reconcile.Request) (reconcile.Result, e
 		r.opConfig.Parameters = opConfig.Data
 	}
 
-	serverVersion, err := r.context.Clientset.Discovery().ServerVersion()
-	if err != nil {
-		return opcontroller.ImmediateRetryResult, errors.Wrap(err, "failed to get server version")
-	}
-
 	enableCSIOperator, err = strconv.ParseBool(k8sutil.GetValue(r.opConfig.Parameters, "ROOK_USE_CSI_OPERATOR", "false"))
 	if err != nil {
 		return reconcileResult, errors.Wrap(err, "unable to parse value for 'ROOK_USE_CSI_OPERATOR'")
@@ -203,7 +197,7 @@ func (r *ReconcileCSI) reconcile(request reconcile.Request) (reconcile.Result, e
 		if kerrors.IsNotFound(err) {
 			logger.Debug("no ceph cluster found not deploying ceph csi driver")
 			EnableRBD, EnableCephFS, EnableNFS = false, false, false
-			err = r.stopDrivers(serverVersion)
+			err = r.stopDrivers()
 			if err != nil {
 				return opcontroller.ImmediateRetryResult, errors.Wrap(err, "failed to stop Drivers")
 			}
@@ -218,7 +212,7 @@ func (r *ReconcileCSI) reconcile(request reconcile.Request) (reconcile.Result, e
 	if len(cephClusters.Items) == 0 {
 		logger.Debug("no ceph cluster found not deploying ceph csi driver")
 		EnableRBD, EnableCephFS, EnableNFS = false, false, false
-		err = r.stopDrivers(serverVersion)
+		err = r.stopDrivers()
 		if err != nil {
 			return opcontroller.ImmediateRetryResult, errors.Wrap(err, "failed to stop Drivers")
 		}
@@ -280,11 +274,11 @@ func (r *ReconcileCSI) reconcile(request reconcile.Request) (reconcile.Result, e
 		// disable Rook-managed CSI drivers if CSI operator is enabled
 		if EnableCSIOperator() {
 			logger.Info("disabling csi-driver since EnableCSIOperator is true")
-			err := r.stopDrivers(serverVersion)
+			err := r.stopDrivers()
 			if err != nil {
 				return opcontroller.ImmediateRetryResult, errors.Wrap(err, "failed to stop csi Drivers")
 			}
-			err = r.reconcileOperatorConfig(cluster, clusterInfo, serverVersion)
+			err = r.reconcileOperatorConfig(cluster, clusterInfo)
 			if err != nil {
 				return opcontroller.ImmediateRetryResult, errors.Wrap(err, "failed to reconcile csi-op config CR")
 			}
@@ -293,7 +287,7 @@ func (r *ReconcileCSI) reconcile(request reconcile.Request) (reconcile.Result, e
 	}
 
 	if !disableCSI && !EnableCSIOperator() {
-		err = r.validateAndConfigureDrivers(serverVersion, ownerInfo)
+		err = r.validateAndConfigureDrivers(ownerInfo)
 		if err != nil {
 			return opcontroller.ImmediateRetryResult, errors.Wrap(err, "failed to configure ceph csi")
 		}
@@ -302,8 +296,8 @@ func (r *ReconcileCSI) reconcile(request reconcile.Request) (reconcile.Result, e
 	return reconcileResult, nil
 }
 
-func (r *ReconcileCSI) reconcileOperatorConfig(cluster cephv1.CephCluster, clusterInfo *cephclient.ClusterInfo, serverVersion *version.Info) error {
-	if err := r.setParams(serverVersion); err != nil {
+func (r *ReconcileCSI) reconcileOperatorConfig(cluster cephv1.CephCluster, clusterInfo *cephclient.ClusterInfo) error {
+	if err := r.setParams(); err != nil {
 		return errors.Wrapf(err, "failed to configure CSI parameters")
 	}
 
diff --git a/pkg/operator/ceph/csi/csi.go b/pkg/operator/ceph/csi/csi.go
index 4313eb0ef..b1ab03618 100644
--- a/pkg/operator/ceph/csi/csi.go
+++ b/pkg/operator/ceph/csi/csi.go
@@ -28,16 +28,14 @@ import (
 	"github.com/pkg/errors"
 	kerrors "k8s.io/apimachinery/pkg/api/errors"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-	"k8s.io/apimachinery/pkg/version"
 )
 
-func (r *ReconcileCSI) validateAndConfigureDrivers(serverVersion *version.Info, ownerInfo *k8sutil.OwnerInfo) error {
+func (r *ReconcileCSI) validateAndConfigureDrivers(ownerInfo *k8sutil.OwnerInfo) error {
 	var (
-		v   *CephCSIVersion
 		err error
 	)
 
-	if err = r.setParams(serverVersion); err != nil {
+	if err = r.setParams(); err != nil {
 		return errors.Wrapf(err, "failed to configure CSI parameters")
 	}
 
@@ -45,25 +43,17 @@ func (r *ReconcileCSI) validateAndConfigureDrivers(serverVersion *version.Info,
 		return errors.Wrapf(err, "failed to validate CSI parameters")
 	}
 
-	if !AllowUnsupported && CSIEnabled() {
-		if v, err = r.validateCSIVersion(ownerInfo); err != nil {
-			return errors.Wrapf(err, "invalid csi version")
-		}
-	} else {
-		logger.Info("skipping csi version check, since unsupported versions are allowed or csi is disabled")
-	}
-
 	if CSIEnabled() {
-		if err = r.startDrivers(serverVersion, ownerInfo, v); err != nil {
+		if err = r.startDrivers(ownerInfo); err != nil {
 			return errors.Wrap(err, "failed to start ceph csi drivers")
 		}
 	}
 
 	// Check whether RBD or CephFS needs to be disabled
-	return r.stopDrivers(serverVersion)
+	return r.stopDrivers()
 }
 
-func (r *ReconcileCSI) setParams(ver *version.Info) error {
+func (r *ReconcileCSI) setParams() error {
 	var err error
 
 	if EnableRBD, err = strconv.ParseBool(k8sutil.GetValue(r.opConfig.Parameters, "ROOK_CSI_ENABLE_RBD", "true")); err != nil {
@@ -78,10 +68,6 @@ func (r *ReconcileCSI) setParams(ver *version.Info) error {
 		return errors.Wrap(err, "unable to parse value for 'ROOK_CSI_ENABLE_NFS'")
 	}
 
-	if AllowUnsupported, err = strconv.ParseBool(k8sutil.GetValue(r.opConfig.Parameters, "ROOK_CSI_ALLOW_UNSUPPORTED_VERSION", "false")); err != nil {
-		return errors.Wrap(err, "unable to parse value for 'ROOK_CSI_ALLOW_UNSUPPORTED_VERSION'")
-	}
-
 	if CSIParam.EnableCSIHostNetwork, err = strconv.ParseBool(k8sutil.GetValue(r.opConfig.Parameters, "CSI_ENABLE_HOST_NETWORK", "true")); err != nil {
 		return errors.Wrap(err, "failed to parse value for 'CSI_ENABLE_HOST_NETWORK'")
 	}
@@ -139,10 +125,7 @@ func (r *ReconcileCSI) setParams(ver *version.Info) error {
 		CSIParam.EnableOMAPGenerator = true
 	}
 
-	// CSIDriver SeLinuxMount option is only available from kubernetes version 1.25.
-	if ver.Major == kubeMinMajor && ver.Minor >= kubeMinVerForCSIDriverSeLinuxMount {
-		CSIParam.EnableCSIDriverSeLinuxMount = true
-	}
+	CSIParam.EnableCSIDriverSeLinuxMount = true
 
 	CSIParam.EnableRBDSnapshotter = true
 	if strings.EqualFold(k8sutil.GetValue(r.opConfig.Parameters, "CSI_ENABLE_RBD_SNAPSHOTTER", "true"), "false") {
@@ -213,8 +196,6 @@ func (r *ReconcileCSI) setParams(ver *version.Info) error {
 		CSIParam.EnablePluginSelinuxHostMount = true
 	}
 
-	logger.Infof("Kubernetes version is %s.%s", ver.Major, ver.Minor)
-
 	logLevel := k8sutil.GetValue(r.opConfig.Parameters, "CSI_LOG_LEVEL", "")
 	CSIParam.LogLevel = defaultLogLevel
 	if logLevel != "" {
diff --git a/pkg/operator/ceph/csi/spec.go b/pkg/operator/ceph/csi/spec.go
index 59af7f601..f3e14a681 100644
--- a/pkg/operator/ceph/csi/spec.go
+++ b/pkg/operator/ceph/csi/spec.go
@@ -24,11 +24,8 @@ import (
 	"strings"
 	"time"
 
-	cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
-	"github.com/rook/rook/pkg/operator/ceph/cluster/telemetry"
 	opcontroller "github.com/rook/rook/pkg/operator/ceph/controller"
 	"github.com/rook/rook/pkg/operator/k8sutil"
-	"github.com/rook/rook/pkg/operator/k8sutil/cmdreporter"
 
 	"github.com/pkg/errors"
 	apps "k8s.io/api/apps/v1"
@@ -36,7 +33,6 @@ import (
 	k8scsi "k8s.io/api/storage/v1beta1"
 	kerrors "k8s.io/apimachinery/pkg/api/errors"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-	"k8s.io/apimachinery/pkg/version"
 	"k8s.io/client-go/kubernetes"
 )
 
@@ -117,7 +113,6 @@ var (
 	EnableCephFS              = false
 	EnableNFS                 = false
 	enableCSIOperator         = false
-	AllowUnsupported          = false
 	CustomCSICephConfigExists = false
 
 	// driver names
@@ -178,9 +173,6 @@ var (
 )
 
 const (
-	kubeMinMajor                       = "1"
-	kubeMinVerForCSIDriverSeLinuxMount = "25"
-
 	// common tolerations and node affinity
 	provisionerTolerationsEnv  = "CSI_PROVISIONER_TOLERATIONS"
 	provisionerNodeAffinityEnv = "CSI_PROVISIONER_NODE_AFFINITY"
@@ -234,7 +226,6 @@ const (
 	DefaultRBDLivenessMerticsPort    uint16 = 9080
 	DefaultCSIAddonsPort             uint16 = 9070
 
-	detectCSIVersionName = "rook-ceph-csi-detect-version"
 	// default log level for csi containers
 	defaultLogLevel        uint8 = 0
 	defaultSidecarLogLevel uint8 = 0
@@ -304,7 +295,7 @@ func validateCSIParam() error {
 	return nil
 }
 
-func (r *ReconcileCSI) startDrivers(ver *version.Info, ownerInfo *k8sutil.OwnerInfo, v *CephCSIVersion) error {
+func (r *ReconcileCSI) startDrivers(ownerInfo *k8sutil.OwnerInfo) error {
 	var (
 		err                                                                             error
 		rbdPlugin, cephfsPlugin, nfsPlugin                                              *apps.DaemonSet
@@ -659,14 +650,14 @@ func (r *ReconcileCSI) startDrivers(ver *version.Info, ownerInfo *k8sutil.OwnerI
 	return nil
 }
 
-func (r *ReconcileCSI) stopDrivers(ver *version.Info) error {
+func (r *ReconcileCSI) stopDrivers() error {
 	RBDDriverName = fmt.Sprintf("%s.rbd.csi.ceph.com", r.opConfig.OperatorNamespace)
 	CephFSDriverName = fmt.Sprintf("%s.cephfs.csi.ceph.com", r.opConfig.OperatorNamespace)
 	NFSDriverName = fmt.Sprintf("%s.nfs.csi.ceph.com", r.opConfig.OperatorNamespace)
 
 	if !EnableRBD || EnableCSIOperator() {
 		logger.Debugf("either EnableRBD if `false` or EnableCSIOperator is `true`, `EnableRBD is %t` and `EnableCSIOperator is %t", EnableRBD, EnableCSIOperator())
-		err := r.deleteCSIDriverResources(ver, CsiRBDPlugin, csiRBDProvisioner, "csi-rbdplugin-metrics", RBDDriverName)
+		err := r.deleteCSIDriverResources(CsiRBDPlugin, csiRBDProvisioner, "csi-rbdplugin-metrics", RBDDriverName)
 		if err != nil {
 			return errors.Wrap(err, "failed to remove CSI Ceph RBD driver")
 		}
@@ -675,7 +666,7 @@ func (r *ReconcileCSI) stopDrivers(ver *version.Info) error {
 
 	if !EnableCephFS || EnableCSIOperator() {
 		logger.Debugf("either EnableCephFS if `false` or EnableCSIOperator is `true`, `EnableCephFS is %t` and `EnableCSIOperator is %t", EnableRBD, EnableCSIOperator())
-		err := r.deleteCSIDriverResources(ver, CsiCephFSPlugin, csiCephFSProvisioner, "csi-cephfsplugin-metrics", CephFSDriverName)
+		err := r.deleteCSIDriverResources(CsiCephFSPlugin, csiCephFSProvisioner, "csi-cephfsplugin-metrics", CephFSDriverName)
 		if err != nil {
 			return errors.Wrap(err, "failed to remove CSI CephFS driver")
 		}
@@ -684,7 +675,7 @@ func (r *ReconcileCSI) stopDrivers(ver *version.Info) error {
 
 	if !EnableNFS || EnableCSIOperator() {
 		logger.Debugf("either EnableNFS if `false` or EnableCSIOperator is `true`, `EnableNFS is %t` and `EnableCSIOperator is %t", EnableRBD, EnableCSIOperator())
-		err := r.deleteCSIDriverResources(ver, CsiNFSPlugin, csiNFSProvisioner, "csi-nfsplugin-metrics", NFSDriverName)
+		err := r.deleteCSIDriverResources(CsiNFSPlugin, csiNFSProvisioner, "csi-nfsplugin-metrics", NFSDriverName)
 		if err != nil {
 			return errors.Wrap(err, "failed to remove CSI NFS driver")
 		}
@@ -694,7 +685,7 @@ func (r *ReconcileCSI) stopDrivers(ver *version.Info) error {
 	return nil
 }
 
-func (r *ReconcileCSI) deleteCSIDriverResources(ver *version.Info, daemonset, deployment, service, driverName string) error {
+func (r *ReconcileCSI) deleteCSIDriverResources(daemonset, deployment, service, driverName string) error {
 	csiDriverobj := v1CsiDriver{}
 	err := k8sutil.DeleteDaemonset(r.opManagerContext, r.context.Clientset, r.opConfig.OperatorNamespace, daemonset)
 	if err != nil {
@@ -738,66 +729,6 @@ func (r *ReconcileCSI) applyCephClusterNetworkConfig(ctx context.Context, object
 	return nil
 }
 
-// ValidateCSIVersion checks if the configured ceph-csi image is supported
-func (r *ReconcileCSI) validateCSIVersion(ownerInfo *k8sutil.OwnerInfo) (*CephCSIVersion, error) {
-	timeout := 15 * time.Minute
-
-	logger.Infof("detecting the ceph csi image version for image %q", CSIParam.CSIPluginImage)
-
-	versionReporter, err := cmdreporter.New(
-		r.context.Clientset,
-		ownerInfo,
-		detectCSIVersionName,
-		detectCSIVersionName,
-		r.opConfig.OperatorNamespace,
-		[]string{"cephcsi"},
-		[]string{"--version"},
-		r.opConfig.Image,
-		CSIParam.CSIPluginImage,
-		corev1.PullPolicy(CSIParam.ImagePullPolicy),
-	)
-	if err != nil {
-		return nil, errors.Wrap(err, "failed to set up ceph CSI version job")
-	}
-
-	job := versionReporter.Job()
-	job.Spec.Template.Spec.ServiceAccountName = r.opConfig.ServiceAccount
-
-	// Apply csi provisioner toleration and affinity for csi version check job
-	job.Spec.Template.Spec.Tolerations = getToleration(r.opConfig.Parameters, provisionerTolerationsEnv, []corev1.Toleration{})
-	job.Spec.Template.Spec.Affinity = &corev1.Affinity{
-		NodeAffinity: getNodeAffinity(r.opConfig.Parameters, provisionerNodeAffinityEnv, &corev1.NodeAffinity{}),
-	}
-	if r.firstCephCluster != nil {
-		cephv1.GetCmdReporterAnnotations(r.firstCephCluster.Annotations).ApplyToObjectMeta(&job.Spec.Template.ObjectMeta)
-		cephv1.GetCmdReporterLabels(r.firstCephCluster.Labels).ApplyToObjectMeta(&job.Spec.Template.ObjectMeta)
-	}
-
-	stdout, _, retcode, err := versionReporter.Run(r.opManagerContext, timeout)
-	if err != nil {
-		return nil, errors.Wrap(err, "failed to complete ceph CSI version job")
-	}
-
-	if retcode != 0 {
-		return nil, errors.Errorf("ceph CSI version job returned %d", retcode)
-	}
-
-	version, err := extractCephCSIVersion(stdout)
-	if err != nil {
-		return nil, errors.Wrap(err, "failed to extract ceph CSI version")
-	}
-	logger.Infof("Detected ceph CSI image version: %q", version)
-
-	// Set the CSI version on a package variable so that each cluster reporting the
-	// telemetry can report the same CSI version
-	telemetry.CSIVersion = version.String()
-
-	if !version.Supported() {
-		return nil, errors.Errorf("ceph CSI image needs to be at least version %q", minimum.String())
-	}
-	return version, nil
-}
-
 func validateCSIDriverNamePrefix(ctx context.Context, clientset kubernetes.Interface, namespace, driverNamePrefix string) error {
 	if EnableRBD {
 		rbdDriverNamePrefix, err := getCSIDriverNamePrefixFromDeployment(ctx, clientset, namespace, csiRBDProvisioner, "csi-rbdplugin")
diff --git a/pkg/operator/ceph/csi/version.go b/pkg/operator/ceph/csi/version.go
deleted file mode 100644
index aa4d9bb26..000000000
--- a/pkg/operator/ceph/csi/version.go
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
-Copyright 2020 The Rook Authors. All rights reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package csi
-
-import (
-	"fmt"
-	"regexp"
-	"strconv"
-
-	"github.com/pkg/errors"
-)
-
-var (
-	//minimum supported version is 3.10.0
-	minimum = CephCSIVersion{3, 11, 0}
-	//supportedCSIVersions are versions that rook supports
-	releasev312 = CephCSIVersion{3, 12, 0}
-
-	supportedCSIVersions = []CephCSIVersion{
-		minimum,
-		releasev312,
-	}
-
-	// for parsing the output of `cephcsi`
-	versionCSIPattern = regexp.MustCompile(`v(\d+)\.(\d+)\.(\d+)`)
-)
-
-// CephCSIVersion represents the Ceph CSI version format
-type CephCSIVersion struct {
-	Major  int
-	Minor  int
-	Bugfix int
-}
-
-func (v *CephCSIVersion) String() string {
-	return fmt.Sprintf("v%d.%d.%d",
-		v.Major, v.Minor, v.Bugfix)
-}
-
-// Supported checks if the detected version is part of the known supported CSI versions
-func (v *CephCSIVersion) Supported() bool {
-	if !v.isAtLeast(&minimum) {
-		return false
-	}
-
-	// if AllowUnsupported is set also a csi-image greater than the supported ones are allowed
-	if AllowUnsupported {
-		return true
-	}
-	for _, sv := range supportedCSIVersions {
-		if v.Major == sv.Major {
-			if v.Minor == sv.Minor {
-				if v.Bugfix >= sv.Bugfix {
-					return true
-				}
-			}
-		}
-	}
-	return false
-}
-
-func (v *CephCSIVersion) isAtLeast(version *CephCSIVersion) bool {
-	if v.Major > version.Major {
-		return true
-	}
-	if v.Major == version.Major && v.Minor >= version.Minor {
-		if v.Minor > version.Minor {
-			return true
-		}
-		if v.Bugfix >= version.Bugfix {
-			return true
-		}
-	}
-	return false
-}
-
-// extractCephCSIVersion extracts the major, minor and extra digit of a Ceph CSI release
-func extractCephCSIVersion(src string) (*CephCSIVersion, error) {
-	m := versionCSIPattern.FindStringSubmatch(src)
-	if m == nil || len(m) < 3 {
-		return nil, errors.Errorf("failed to parse version from: %q", CSIParam.CSIPluginImage)
-	}
-
-	major, err := strconv.Atoi(m[1])
-	if err != nil {
-		return nil, errors.Wrapf(err, "failed to parse version major part: %q", m[0])
-	}
-
-	minor, err := strconv.Atoi(m[2])
-	if err != nil {
-		return nil, errors.Wrapf(err, "failed to parse version minor part: %q", m[1])
-	}
-
-	bugfix, err := strconv.Atoi(m[3])
-	if err != nil {
-		return nil, errors.Wrapf(err, "failed to parse version bugfix part: %q", m[2])
-	}
-
-	return &CephCSIVersion{major, minor, bugfix}, nil
-}


Test patch:
diff --git a/pkg/operator/ceph/csi/controller_test.go b/pkg/operator/ceph/csi/controller_test.go
index b1998bab4..2df439cef 100644
--- a/pkg/operator/ceph/csi/controller_test.go
+++ b/pkg/operator/ceph/csi/controller_test.go
@@ -61,7 +61,6 @@ func TestCephCSIController(t *testing.T) {
 	t.Setenv(k8sutil.PodNameEnvVar, "rook-ceph-operator")
 	t.Setenv(k8sutil.PodNamespaceEnvVar, namespace)
 
-	t.Setenv("ROOK_CSI_ALLOW_UNSUPPORTED_VERSION", "true")
 	CSIParam = Param{
 		CSIPluginImage:   "image",
 		RegistrarImage:   "image",
diff --git a/pkg/operator/ceph/csi/version_test.go b/pkg/operator/ceph/csi/version_test.go
deleted file mode 100644
index 7bd518c6b..000000000
--- a/pkg/operator/ceph/csi/version_test.go
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
-Copyright 2020 The Rook Authors. All rights reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-	http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package csi
-
-import (
-	"testing"
-
-	"github.com/stretchr/testify/assert"
-)
-
-var (
-	testMinVersion   = CephCSIVersion{3, 11, 0}
-	testReleaseV390  = CephCSIVersion{3, 9, 0}
-	testReleaseV391  = CephCSIVersion{3, 9, 1}
-	testreleasev310  = CephCSIVersion{3, 10, 0}
-	testReleaseV3101 = CephCSIVersion{3, 10, 1}
-	testReleaseV3102 = CephCSIVersion{3, 10, 2}
-	testReleaseV3110 = CephCSIVersion{3, 11, 0}
-	testReleaseV3120 = CephCSIVersion{3, 12, 0}
-
-	testVersionUnsupported = CephCSIVersion{4, 0, 0}
-)
-
-func TestIsAtLeast(t *testing.T) {
-	// Test version which is smaller
-	var version = CephCSIVersion{1, 40, 10}
-	ret := testMinVersion.isAtLeast(&version)
-	assert.Equal(t, true, ret)
-
-	// Test version which is equal
-	ret = testMinVersion.isAtLeast(&testMinVersion)
-	assert.Equal(t, true, ret)
-
-	// Test for 3.9.0
-	ret = testReleaseV390.isAtLeast(&testMinVersion)
-	assert.Equal(t, false, ret)
-
-	// Test for 3.9.1
-	ret = testReleaseV391.isAtLeast(&testMinVersion)
-	assert.Equal(t, false, ret)
-
-	// Test for 3.10.0
-	ret = testreleasev310.isAtLeast(&testReleaseV390)
-	assert.Equal(t, true, ret)
-
-	// Test for 3.10.1
-	ret = testReleaseV3101.isAtLeast(&testReleaseV3101)
-	assert.Equal(t, true, ret)
-
-	// Test for 3.10.2
-	ret = testReleaseV3102.isAtLeast(&testReleaseV3102)
-	assert.Equal(t, true, ret)
-
-	// Test for 3.11.0
-	ret = testReleaseV3110.isAtLeast(&testReleaseV3110)
-	assert.Equal(t, true, ret)
-
-	// Test for 3.12.0
-	ret = testReleaseV3120.isAtLeast(&testReleaseV3120)
-	assert.Equal(t, true, ret)
-
-}
-
-func TestSupported(t *testing.T) {
-	AllowUnsupported = false
-	ret := testMinVersion.Supported()
-	assert.Equal(t, true, ret)
-
-	ret = testVersionUnsupported.Supported()
-	assert.Equal(t, false, ret)
-
-	// 3.9.x is not supported after 3.11.0 release
-	ret = testReleaseV390.Supported()
-	assert.Equal(t, false, ret)
-
-	ret = testReleaseV391.Supported()
-	assert.Equal(t, false, ret)
-
-	ret = testreleasev310.Supported()
-	assert.Equal(t, false, ret)
-
-	ret = testReleaseV3101.Supported()
-	assert.Equal(t, false, ret)
-
-	ret = testReleaseV3110.Supported()
-	assert.Equal(t, true, ret)
-
-	ret = testReleaseV3120.Supported()
-	assert.Equal(t, true, ret)
-}
-
-func Test_extractCephCSIVersion(t *testing.T) {
-	expectedVersion := CephCSIVersion{3, 0, 0}
-	csiString := []byte(`Cephcsi Version: v3.0.0
-		Git Commit: e58d537a07ca0184f67d33db85bf6b4911624b44
-		Go Version: go1.12.15
-		Compiler: gc
-		Platform: linux/amd64
-		`)
-	version, err := extractCephCSIVersion(string(csiString))
-
-	assert.Equal(t, &expectedVersion, version)
-	assert.Nil(t, err)
-
-	csiString = []byte(`Cephcsi Version: rubbish
-	Git Commit: e58d537a07ca0184f67d33db85bf6b4911624b44
-	Go Version: go1.12.15
-	Compiler: gc
-	Platform: linux/amd64
-	`)
-	version, err = extractCephCSIVersion(string(csiString))
-
-	assert.Nil(t, version)
-	assert.Contains(t, err.Error(), "failed to parse version from")
-}