Repository: rook/rook
Pull request #6769 (2020-12-04 13:47:55)

ceph: update csi to v3.2.0
<!-- Please take a look at our [Contributing](https://rook.io/docs/rook/master/development-flow.html)
documentation before submitting a Pull Request!
Thank you for contributing to Rook! -->

**Description of your changes:**
updating cephcsi to the latest release version and also added an option to disable omap-generator sidecar deployment.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>

**Which issue is 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/master/development-flow.html#commit-structure).
- [ ] **Skip Tests for Docs**: Add the flag for skipping the build if this is only a documentation change. See [here](https://github.com/rook/rook/blob/master/INSTALL.md#skip-ci) for the flag.
- [ ] **Skip Unrelated Tests**: Add a flag to run tests for a specific storage provider. See [test options](https://github.com/rook/rook/blob/master/INSTALL.md#test-storage-provider).
- [ ] Reviewed the developer guide on [Submitting a Pull Request](https://rook.io/docs/rook/master/development-flow.html#submitting-a-pull-request)
- [ ] Documentation has been updated, if necessary.
- [ ] Unit tests have been added, if necessary.
- [ ] Integration tests have been added, if necessary.
- [ ] Pending release notes updated with breaking and/or notable changes, if necessary.
- [ ] Upgrade from previous release is tested and upgrade user guide is updated, if necessary.
- [ ] Code generation (`make codegen`) has been run to update object specifications, if necessary.
[skip ci]


Madhu-1: @travisn @BlaineEXE PTAL
Madhu-1: cephcsi v3.2.0 is release is available now https://github.com/ceph/ceph-csi/releases/tag/v3.2.0. This is ready for review

Patch:
diff --git a/Documentation/ceph-block.md b/Documentation/ceph-block.md
index 0e9232baf..044794862 100644
--- a/Documentation/ceph-block.md
+++ b/Documentation/ceph-block.md
@@ -54,6 +54,20 @@ parameters:
     # Ceph pool into which the RBD image shall be created
     pool: replicapool
 
+    # (optional) mapOptions is a comma-separated list of map options.
+    # For krbd options refer
+    # https://docs.ceph.com/docs/master/man/8/rbd/#kernel-rbd-krbd-options
+    # For nbd options refer
+    # https://docs.ceph.com/docs/master/man/8/rbd-nbd/#options
+    # mapOptions: lock_on_read,queue_depth=1024
+
+    # (optional) unmapOptions is a comma-separated list of unmap options.
+    # For krbd options refer
+    # https://docs.ceph.com/docs/master/man/8/rbd/#kernel-rbd-krbd-options
+    # For nbd options refer
+    # https://docs.ceph.com/docs/master/man/8/rbd-nbd/#options
+    # unmapOptions: force
+
     # RBD image format. Defaults to "2".
     imageFormat: "2"
 
diff --git a/Documentation/ceph-upgrade.md b/Documentation/ceph-upgrade.md
index e03811883..affa1cd2c 100644
--- a/Documentation/ceph-upgrade.md
+++ b/Documentation/ceph-upgrade.md
@@ -409,7 +409,7 @@ kubectl -n $ROOK_NAMESPACE edit configmap rook-ceph-operator-config
 The default upstream images are included below, which you can change to your desired images.
 
 ```yaml
-ROOK_CSI_CEPH_IMAGE: "quay.io/cephcsi/cephcsi:v3.1.2"
+ROOK_CSI_CEPH_IMAGE: "quay.io/cephcsi/cephcsi:v3.2.0"
 ROOK_CSI_REGISTRAR_IMAGE: "k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.0.1"
 ROOK_CSI_PROVISIONER_IMAGE: "k8s.gcr.io/sig-storage/csi-provisioner:v2.0.0"
 ROOK_CSI_SNAPSHOTTER_IMAGE: "k8s.gcr.io/sig-storage/csi-snapshotter:v3.0.0"
@@ -428,7 +428,7 @@ You can use the below command to see the CSI images currently being used in the
 
 ```console
 # kubectl --namespace rook-ceph get pod -o jsonpath='{range .items[*]}{range .spec.containers[*]}{.image}{"\n"}' -l 'app in (csi-rbdplugin,csi-rbdplugin-provisioner,csi-cephfsplugin,csi-cephfsplugin-provisioner)' | sort | uniq
-quay.io/cephcsi/cephcsi:v3.1.2
+quay.io/cephcsi/cephcsi:v3.2.0
 k8s.gcr.io/sig-storage/csi-attacher:v3.0.0
 k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.0.1
 k8s.gcr.io/sig-storage/csi-provisioner:v2.0.0
diff --git a/Documentation/helm-operator.md b/Documentation/helm-operator.md
index 6eb21ff82..0113612f5 100644
--- a/Documentation/helm-operator.md
+++ b/Documentation/helm-operator.md
@@ -101,6 +101,7 @@ The following tables lists the configurable parameters of the rook-operator char
 | `csi.enableCephfsDriver`           | Enable Ceph CSI CephFS driver.                                                                                                 | `true`                                                    |
 | `csi.pluginPriorityClassName`      | PriorityClassName to be set on csi driver plugin pods.                                                                         | <none>                                                    |
 | `csi.provisionerPriorityClassName` | PriorityClassName to be set on csi driver provisioner pods.                                                                    | <none>                                                    |
+| `csi.enableOMAPGenerator`          | EnableOMAP generator deploys omap sidecar in CSI provisioner pod, to enable it set it to true                                  | `false`                                                    |
 | `csi.logLevel`                     | Set logging level for csi containers. Supported values from 0 to 5. 0 for general useful logs, 5 for trace level verbosity.    | `0`                                                       |
 | `csi.enableGrpcMetrics`            | Enable Ceph CSI GRPC Metrics.                                                                                                  | `true`                                                    |
 | `csi.provisionerTolerations`       | Array of tolerations in YAML format which will be added to CSI provisioner deployment.                                         | <none>                                                    |
@@ -117,7 +118,7 @@ The following tables lists the configurable parameters of the rook-operator char
 | `csi.rbdLivenessMetricsPort`       | Ceph CSI RBD driver metrics port.                                                                                              | `8080`                                                    |
 | `csi.forceCephFSKernelClient`      | Enable Ceph Kernel clients on kernel < 4.17 which support quotas for Cephfs.                                                   | `true`                                                    |
 | `csi.kubeletDirPath`               | Kubelet root directory path (if the Kubelet uses a different path for the `--root-dir` flag)                                   | `/var/lib/kubelet`                                        |
-| `csi.cephcsi.image`                | Ceph CSI image.                                                                                                                | `quay.io/cephcsi/cephcsi:v3.1.2`                          |
+| `csi.cephcsi.image`                | Ceph CSI image.                                                                                                                | `quay.io/cephcsi/cephcsi:v3.2.0`                          |
 | `csi.rbdPluginUpdateStrategy`      | CSI Rbd plugin daemonset update strategy, supported values are OnDelete and RollingUpdate.                                     | `OnDelete`                                                |
 | `csi.cephFSPluginUpdateStrategy`   | CSI CephFS plugin daemonset update strategy, supported values are OnDelete and RollingUpdate.                                  | `OnDelete`                                                |
 | `csi.registrar.image`              | Kubernetes CSI registrar image.                                                                                                | `k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.0.1` |
diff --git a/cluster/charts/rook-ceph/templates/deployment.yaml b/cluster/charts/rook-ceph/templates/deployment.yaml
index a5b1df4a1..aee9194c9 100644
--- a/cluster/charts/rook-ceph/templates/deployment.yaml
+++ b/cluster/charts/rook-ceph/templates/deployment.yaml
@@ -114,6 +114,8 @@ spec:
           value: {{ .Values.csi.pluginPriorityClassName | quote }}
         - name: CSI_PROVISIONER_PRIORITY_CLASSNAME
           value: {{ .Values.csi.provisionerPriorityClassName | quote }}
+        - name: CSI_ENABLE_OMAP_GENERATOR
+          value: {{ .Values.csi.enableOMAPGenerator | quote }}
 {{- if .Values.csi.cephFSPluginUpdateStrategy }}
         - name: CSI_CEPHFS_PLUGIN_UPDATE_STRATEGY
           value: {{ .Values.csi.cephFSPluginUpdateStrategy | quote }}
diff --git a/cluster/charts/rook-ceph/values.yaml b/cluster/charts/rook-ceph/values.yaml
index 952b89e84..c435a4697 100644
--- a/cluster/charts/rook-ceph/values.yaml
+++ b/cluster/charts/rook-ceph/values.yaml
@@ -62,6 +62,13 @@ csi:
   # (Optional) set user created priorityclassName for csi provisioner pods.
   # provisionerPriorityClassName: system-cluster-critical
 
+  # OMAP generator generates the omap mapping between the PV name and the RBD image
+  # which helps CSI to identify the rbd images for CSI operations.
+  # CSI_ENABLE_OMAP_GENERATOR need to be enabled when we are using rbd mirroring feature.
+  # By default OMAP generator is disabled and when enabled it will be deployed as a
+  # sidecar with CSI provisioner pod, to enable set it to true.
+  enableOMAPGenerator: false
+
   # Set logging level for csi containers.
   # Supported values from 0 to 5. 0 for general useful logs, 5 for trace level verbosity.
   #logLevel: 0
@@ -245,7 +252,7 @@ csi:
   #rbdLivenessMetricsPort: 9080
   #kubeletDirPath: /var/lib/kubelet
   #cephcsi:
-    #image: quay.io/cephcsi/cephcsi:v3.1.2
+    #image: quay.io/cephcsi/cephcsi:v3.2.0
   #registrar:
     #image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.0.1
   #provisioner:
diff --git a/cluster/examples/kubernetes/ceph/csi/rbd/storageclass-ec.yaml b/cluster/examples/kubernetes/ceph/csi/rbd/storageclass-ec.yaml
index 4a3b5e347..dca9d2566 100644
--- a/cluster/examples/kubernetes/ceph/csi/rbd/storageclass-ec.yaml
+++ b/cluster/examples/kubernetes/ceph/csi/rbd/storageclass-ec.yaml
@@ -45,6 +45,20 @@ parameters:
     dataPool: ec-data-pool
     pool: replicated-metadata-pool
 
+    # (optional) mapOptions is a comma-separated list of map options.
+    # For krbd options refer
+    # https://docs.ceph.com/docs/master/man/8/rbd/#kernel-rbd-krbd-options
+    # For nbd options refer
+    # https://docs.ceph.com/docs/master/man/8/rbd-nbd/#options
+    # mapOptions: lock_on_read,queue_depth=1024
+
+    # (optional) unmapOptions is a comma-separated list of unmap options.
+    # For krbd options refer
+    # https://docs.ceph.com/docs/master/man/8/rbd/#kernel-rbd-krbd-options
+    # For nbd options refer
+    # https://docs.ceph.com/docs/master/man/8/rbd-nbd/#options
+    # unmapOptions: force
+
     # RBD image format. Defaults to "2".
     imageFormat: "2"
 
diff --git a/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml b/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml
index c2df6f4dc..daf9f6c7b 100644
--- a/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml
+++ b/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml
@@ -33,6 +33,20 @@ parameters:
     #dataPool: ec-data-pool
     pool: replicapool
 
+    # (optional) mapOptions is a comma-separated list of map options.
+    # For krbd options refer
+    # https://docs.ceph.com/docs/master/man/8/rbd/#kernel-rbd-krbd-options
+    # For nbd options refer
+    # https://docs.ceph.com/docs/master/man/8/rbd-nbd/#options
+    # mapOptions: lock_on_read,queue_depth=1024
+
+    # (optional) unmapOptions is a comma-separated list of unmap options.
+    # For krbd options refer
+    # https://docs.ceph.com/docs/master/man/8/rbd/#kernel-rbd-krbd-options
+    # For nbd options refer
+    # https://docs.ceph.com/docs/master/man/8/rbd-nbd/#options
+    # unmapOptions: force
+
     # RBD image format. Defaults to "2".
     imageFormat: "2"
 
diff --git a/cluster/examples/kubernetes/ceph/csi/template/rbd/csi-rbdplugin-provisioner-dep.yaml b/cluster/examples/kubernetes/ceph/csi/template/rbd/csi-rbdplugin-provisioner-dep.yaml
index 4367c3421..a51bf993a 100644
--- a/cluster/examples/kubernetes/ceph/csi/template/rbd/csi-rbdplugin-provisioner-dep.yaml
+++ b/cluster/examples/kubernetes/ceph/csi/template/rbd/csi-rbdplugin-provisioner-dep.yaml
@@ -85,6 +85,26 @@ spec:
           volumeMounts:
             - name: socket-dir
               mountPath: /csi
+        {{ if .EnableOMAPGenerator }}
+        - name: csi-omap-generator
+          image: {{ .CSIPluginImage }}
+          args :
+            - "--type=controller"
+            - "--drivernamespace=$(DRIVER_NAMESPACE)"
+            - "--v={{ .LogLevel }}"
+            - "--drivername={{ .DriverNamePrefix }}rbd.csi.ceph.com"
+          env:
+            - name: DRIVER_NAMESPACE
+              valueFrom:
+                fieldRef:
+                  fieldPath: metadata.namespace
+          imagePullPolicy: "IfNotPresent"
+          volumeMounts:
+            - name: ceph-csi-config
+              mountPath: /etc/ceph-csi-config/
+            - name: keys-tmp-dir
+              mountPath: /tmp/csi/keys
+        {{ end }}
         - name: csi-rbdplugin
           image: {{ .CSIPluginImage }}
           args :
diff --git a/cluster/examples/kubernetes/ceph/operator-openshift.yaml b/cluster/examples/kubernetes/ceph/operator-openshift.yaml
index 9639a0741..3a13851d7 100644
--- a/cluster/examples/kubernetes/ceph/operator-openshift.yaml
+++ b/cluster/examples/kubernetes/ceph/operator-openshift.yaml
@@ -109,6 +109,13 @@ data:
   # Supported values from 0 to 5. 0 for general useful logs, 5 for trace level verbosity.
   # CSI_LOG_LEVEL: "0"
 
+  # OMAP generator generates the omap mapping between the PV name and the RBD image
+  # which helps CSI to identify the rbd images for CSI operations.
+  # CSI_ENABLE_OMAP_GENERATOR need to be enabled when we are using rbd mirroring feature.
+  # By default OMAP generator is disabled and when enabled it willbe deployed as a
+  # sidecar with CSI provisioner pod, to enable set it to true.
+  # CSI_ENABLE_OMAP_GENERATOR: "true"
+
   # Enable Ceph Kernel clients on kernel < 4.17 which support quotas for Cephfs
   # If you disable the kernel client, your application may be disrupted during upgrade.
   # See the upgrade guide: https://rook.io/docs/rook/master/ceph-upgrade.html
@@ -119,7 +126,7 @@ data:
   # The default version of CSI supported by Rook will be started. To change the version
   # of the CSI driver to something other than what is officially supported, change
   # these images to the desired release of the CSI driver.
-  # ROOK_CSI_CEPH_IMAGE: "quay.io/cephcsi/cephcsi:v3.1.2"
+  # ROOK_CSI_CEPH_IMAGE: "quay.io/cephcsi/cephcsi:v3.2.0"
   # ROOK_CSI_REGISTRAR_IMAGE: "k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.0.1"
   # ROOK_CSI_RESIZER_IMAGE: "k8s.gcr.io/sig-storage/csi-resizer:v1.0.0"
   # ROOK_CSI_PROVISIONER_IMAGE: "k8s.gcr.io/sig-storage/csi-provisioner:v2.0.0"
diff --git a/cluster/examples/kubernetes/ceph/operator.yaml b/cluster/examples/kubernetes/ceph/operator.yaml
index 3b7505686..26f46243a 100644
--- a/cluster/examples/kubernetes/ceph/operator.yaml
+++ b/cluster/examples/kubernetes/ceph/operator.yaml
@@ -33,6 +33,12 @@ data:
   # Supported values from 0 to 5. 0 for general useful logs, 5 for trace level verbosity.
   # CSI_LOG_LEVEL: "0"
 
+  # OMAP generator will generate the omap mapping between the PV name and the RBD image.
+  # CSI_ENABLE_OMAP_GENERATOR need to be enabled when we are using rbd mirroring feature.
+  # By default OMAP generator sidecar is deployed with CSI provisioner pod, to disable
+  # it set it to false.
+  # CSI_ENABLE_OMAP_GENERATOR: "false"
+
   # Enable cephfs kernel driver instead of ceph-fuse.
   # If you disable the kernel client, your application may be disrupted during upgrade.
   # See the upgrade guide: https://rook.io/docs/rook/master/ceph-upgrade.html
@@ -44,7 +50,7 @@ data:
   # The default version of CSI supported by Rook will be started. To change the version
   # of the CSI driver to something other than what is officially supported, change
   # these images to the desired release of the CSI driver.
-  # ROOK_CSI_CEPH_IMAGE: "quay.io/cephcsi/cephcsi:v3.1.2"
+  # ROOK_CSI_CEPH_IMAGE: "quay.io/cephcsi/cephcsi:v3.2.0"
   # ROOK_CSI_REGISTRAR_IMAGE: "k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.0.1"
   # ROOK_CSI_RESIZER_IMAGE: "k8s.gcr.io/sig-storage/csi-resizer:v1.0.0"
   # ROOK_CSI_PROVISIONER_IMAGE: "k8s.gcr.io/sig-storage/csi-provisioner:v2.0.0"
diff --git a/pkg/operator/ceph/csi/csi.go b/pkg/operator/ceph/csi/csi.go
index 6005dffe8..4745fc4bc 100644
--- a/pkg/operator/ceph/csi/csi.go
+++ b/pkg/operator/ceph/csi/csi.go
@@ -29,8 +29,10 @@ import (
 )
 
 func ValidateAndConfigureDrivers(context *clusterd.Context, namespace, rookImage, securityAccount string, serverVersion *version.Info, ownerRef *metav1.OwnerReference) {
+	var v *CephCSIVersion
+	var err error
 	if !AllowUnsupported {
-		if err := validateCSIVersion(context.Clientset, namespace, rookImage, securityAccount, ownerRef); err != nil {
+		if v, err = validateCSIVersion(context.Clientset, namespace, rookImage, securityAccount, ownerRef); err != nil {
 			logger.Errorf("invalid csi version. %+v", err)
 			return
 		}
@@ -38,7 +40,7 @@ func ValidateAndConfigureDrivers(context *clusterd.Context, namespace, rookImage
 		logger.Info("Skipping csi version check, since unsupported versions are allowed")
 	}
 
-	if err := startDrivers(context.Clientset, context.RookClientset, namespace, serverVersion, ownerRef); err != nil {
+	if err := startDrivers(context.Clientset, context.RookClientset, namespace, serverVersion, ownerRef, v); err != nil {
 		logger.Errorf("failed to start Ceph csi drivers. %v", err)
 		return
 	}
diff --git a/pkg/operator/ceph/csi/spec.go b/pkg/operator/ceph/csi/spec.go
index 385c93c0f..01ea8a74e 100644
--- a/pkg/operator/ceph/csi/spec.go
+++ b/pkg/operator/ceph/csi/spec.go
@@ -53,6 +53,7 @@ type Param struct {
 	RBDPluginUpdateStrategy      string
 	PluginPriorityClassName      string
 	ProvisionerPriorityClassName string
+	EnableOMAPGenerator          bool
 	LogLevel                     uint8
 	CephFSGRPCMetricsPort        uint16
 	CephFSLivenessMetricsPort    uint16
@@ -101,7 +102,7 @@ var (
 // manually challenging.
 var (
 	// image names
-	DefaultCSIPluginImage   = "quay.io/cephcsi/cephcsi:v3.1.2"
+	DefaultCSIPluginImage   = "quay.io/cephcsi/cephcsi:v3.2.0"
 	DefaultRegistrarImage   = "k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.0.1"
 	DefaultProvisionerImage = "k8s.gcr.io/sig-storage/csi-provisioner:v2.0.0"
 	DefaultAttacherImage    = "k8s.gcr.io/sig-storage/csi-attacher:v3.0.0"
@@ -202,7 +203,7 @@ func ValidateCSIParam() error {
 	return nil
 }
 
-func startDrivers(clientset kubernetes.Interface, rookclientset rookclient.Interface, namespace string, ver *version.Info, ownerRef *metav1.OwnerReference) error {
+func startDrivers(clientset kubernetes.Interface, rookclientset rookclient.Interface, namespace string, ver *version.Info, ownerRef *metav1.OwnerReference, v *CephCSIVersion) error {
 	ctx := context.TODO()
 	var (
 		err                                                   error
@@ -268,6 +269,21 @@ func startDrivers(clientset kubernetes.Interface, rookclientset rookclient.Inter
 		return errors.Wrap(err, "failed to load CSI_PROVISIONER_PRIORITY_CLASSNAME setting")
 	}
 
+	// OMAP generator will be enabled by default
+	// If AllowUnsupported is set to false and if CSI version is less than
+	// <3.2.0 disable OMAP generator sidecar
+	if !v.SupportsOMAPController() {
+		tp.EnableOMAPGenerator = false
+	}
+
+	enableOMAPGenerator, err := k8sutil.GetOperatorSetting(clientset, controllerutil.OperatorSettingConfigMapName, "CSI_ENABLE_OMAP_GENERATOR", "false")
+	if err != nil {
+		return errors.Wrap(err, "failed to load CSI_ENABLE_OMAP_GENERATOR setting")
+	}
+	if strings.EqualFold(enableOMAPGenerator, "true") {
+		tp.EnableOMAPGenerator = true
+	}
+
 	updateStrategy, err := k8sutil.GetOperatorSetting(clientset, controllerutil.OperatorSettingConfigMapName, "CSI_CEPHFS_PLUGIN_UPDATE_STRATEGY", rollingUpdate)
 	if err != nil {
 		return errors.Wrap(err, "failed to load CSI_CEPHFS_PLUGIN_UPDATE_STRATEGY setting")
@@ -606,7 +622,7 @@ func deleteCSIDriverInfo(ctx context.Context, clientset kubernetes.Interface, na
 }
 
 // ValidateCSIVersion checks if the configured ceph-csi image is supported
-func validateCSIVersion(clientset kubernetes.Interface, namespace, rookImage, serviceAccountName string, ownerRef *metav1.OwnerReference) error {
+func validateCSIVersion(clientset kubernetes.Interface, namespace, rookImage, serviceAccountName string, ownerRef *metav1.OwnerReference) (*CephCSIVersion, error) {
 	timeout := 15 * time.Minute
 
 	logger.Infof("detecting the ceph csi image version for image %q", CSIParam.CSIPluginImage)
@@ -619,7 +635,7 @@ func validateCSIVersion(clientset kubernetes.Interface, namespace, rookImage, se
 		rookImage, CSIParam.CSIPluginImage)
 
 	if err != nil {
-		return errors.Wrap(err, "failed to set up ceph CSI version job")
+		return nil, errors.Wrap(err, "failed to set up ceph CSI version job")
 	}
 
 	job := versionReporter.Job()
@@ -629,21 +645,21 @@ func validateCSIVersion(clientset kubernetes.Interface, namespace, rookImage, se
 	job.Spec.Template.Spec.Tolerations = getToleration(clientset, true)
 	stdout, _, retcode, err := versionReporter.Run(timeout)
 	if err != nil {
-		return errors.Wrap(err, "failed to complete ceph CSI version job")
+		return nil, errors.Wrap(err, "failed to complete ceph CSI version job")
 	}
 
 	if retcode != 0 {
-		return errors.Errorf("ceph CSI version job returned %d", retcode)
+		return nil, errors.Errorf("ceph CSI version job returned %d", retcode)
 	}
 
 	version, err := extractCephCSIVersion(stdout)
 	if err != nil {
-		return errors.Wrap(err, "failed to extract ceph CSI version")
+		return nil, errors.Wrap(err, "failed to extract ceph CSI version")
 	}
 	logger.Infof("Detected ceph CSI image version: %q", version)
 
 	if !version.Supported() {
-		return errors.Errorf("ceph CSI image needs to be at least version %q", minimum.String())
+		return nil, errors.Errorf("ceph CSI image needs to be at least version %q", minimum.String())
 	}
-	return nil
+	return version, nil
 }
diff --git a/pkg/operator/ceph/csi/version.go b/pkg/operator/ceph/csi/version.go
index 655a27647..8cb82e404 100644
--- a/pkg/operator/ceph/csi/version.go
+++ b/pkg/operator/ceph/csi/version.go
@@ -31,8 +31,10 @@ var (
 	releaseV210          = CephCSIVersion{2, 1, 0}
 	releasev300          = CephCSIVersion{3, 0, 0}
 	releasev310          = CephCSIVersion{3, 1, 0}
-	supportedCSIVersions = []CephCSIVersion{minimum, releaseV210, releasev300, releasev310}
-
+	releasev320          = CephCSIVersion{3, 2, 0}
+	supportedCSIVersions = []CephCSIVersion{minimum, releaseV210, releasev300, releasev310, releasev320}
+	// omap generator is supported in v3.2.0+
+	omapSupportedVersions = releasev320
 	// for parsing the output of `cephcsi`
 	versionCSIPattern = regexp.MustCompile(`v(\d+)\.(\d+)\.(\d+)`)
 )
@@ -49,6 +51,33 @@ func (v *CephCSIVersion) String() string {
 		v.Major, v.Minor, v.Bugfix)
 }
 
+// SupportsOMAPController checks if the detected version supports OMAP generator
+func (v *CephCSIVersion) SupportsOMAPController() bool {
+
+	// if AllowUnsupported is set also a csi-image greater than the supported ones are allowed
+	if AllowUnsupported {
+		return true
+	}
+
+	if !v.isAtLeast(&minimum) {
+		return false
+	}
+
+	if v.Major > omapSupportedVersions.Major {
+		return true
+	}
+	if v.Major == omapSupportedVersions.Major {
+		if v.Minor > omapSupportedVersions.Minor {
+			return true
+		}
+		if v.Minor == omapSupportedVersions.Minor {
+			return v.Bugfix >= omapSupportedVersions.Bugfix
+		}
+	}
+
+	return false
+}
+
 // Supported checks if the detected version is part of the known supported CSI versions
 func (v *CephCSIVersion) Supported() bool {
 	if !v.isAtLeast(&minimum) {


Test patch:
diff --git a/pkg/operator/ceph/csi/spec_test.go b/pkg/operator/ceph/csi/spec_test.go
index 08037514d..272fcd417 100644
--- a/pkg/operator/ceph/csi/spec_test.go
+++ b/pkg/operator/ceph/csi/spec_test.go
@@ -48,6 +48,7 @@ func TestStartCSI(t *testing.T) {
 	if err != nil {
 		assert.Nil(t, err)
 	}
-	err = startDrivers(context.Clientset, context.RookClientset, "ns", serverVersion, nil)
+	AllowUnsupported = true
+	err = startDrivers(context.Clientset, context.RookClientset, "ns", serverVersion, nil, nil)
 	assert.Nil(t, err)
 }
diff --git a/pkg/operator/ceph/csi/version_test.go b/pkg/operator/ceph/csi/version_test.go
index ace6b077c..b298fa34f 100644
--- a/pkg/operator/ceph/csi/version_test.go
+++ b/pkg/operator/ceph/csi/version_test.go
@@ -26,6 +26,9 @@ var (
 	testMinVersion         = CephCSIVersion{2, 0, 0}
 	testReleaseV210        = CephCSIVersion{2, 1, 0}
 	testReleaseV300        = CephCSIVersion{3, 0, 0}
+	testReleaseV320        = CephCSIVersion{3, 2, 0}
+	testReleaseV321        = CephCSIVersion{3, 2, 1}
+	testReleaseV330        = CephCSIVersion{3, 3, 0}
 	testVersionUnsupported = CephCSIVersion{4, 0, 0}
 )
 
@@ -86,6 +89,7 @@ func TestIsAtLeast(t *testing.T) {
 }
 
 func TestSupported(t *testing.T) {
+	AllowUnsupported = false
 	ret := testMinVersion.Supported()
 	assert.Equal(t, true, ret)
 
@@ -96,6 +100,27 @@ func TestSupported(t *testing.T) {
 	assert.Equal(t, false, ret)
 }
 
+func TestSupportOMAPController(t *testing.T) {
+	AllowUnsupported = true
+	ret := testMinVersion.SupportsOMAPController()
+	assert.True(t, ret)
+
+	AllowUnsupported = false
+	ret = testMinVersion.SupportsOMAPController()
+	assert.False(t, ret)
+
+	ret = testReleaseV300.SupportsOMAPController()
+	assert.False(t, ret)
+
+	ret = testReleaseV320.SupportsOMAPController()
+	assert.True(t, ret)
+
+	ret = testReleaseV321.SupportsOMAPController()
+	assert.True(t, ret)
+
+	ret = testReleaseV330.SupportsOMAPController()
+	assert.True(t, ret)
+}
 func Test_extractCephCSIVersion(t *testing.T) {
 	expectedVersion := CephCSIVersion{3, 0, 0}
 	csiString := []byte(`Cephcsi Version: v3.0.0