Repository: rook/rook
Pull request #5318 (2020-04-23 14:01:25)

CSI: update cephcsi to v2.1.0 (bp #5289)
This is an automated backport of pull request #5289 done by Mergify
---


<details>
<summary>Mergify commands and options</summary>

<br />

More conditions and actions can be found in the [documentation](https://doc.mergify.io/).

You can also trigger Mergify actions by commenting on this pull request:

- `@Mergifyio refresh` will re-evaluate the rules
- `@Mergifyio rebase` will rebase this PR on its base branch
- `@Mergifyio update` will merge the base branch into this PR
- `@Mergifyio backport <destination>` will backport this PR on `<destination>` branch

Additionally, on Mergify [dashboard](https://dashboard.mergify.io/) you can:

- look at your merge queues
- generate the Mergify configuration with the simulator.

Finally, you can contact us on https://mergify.io/
</details>

[test ceph]


Patch:
diff --git a/Documentation/helm-operator.md b/Documentation/helm-operator.md
index 926e5afff..d507294d2 100644
--- a/Documentation/helm-operator.md
+++ b/Documentation/helm-operator.md
@@ -132,7 +132,7 @@ The following tables lists the configurable parameters of the rook-operator char
 | `csi.enableSnapshotter`            | Enable deployment of snapshotter container in ceph-csi provisioner.                                                         | `true`                                                 |
 | `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:v2.0.0`                       |
+| `csi.cephcsi.image`                | Ceph CSI image.                                                                                                             | `quay.io/cephcsi/cephcsi:v2.1.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.                                                                                             | `quay.io/k8scsi/csi-node-driver-registrar:v1.2.0`      |
diff --git a/cluster/charts/rook-ceph/values.yaml b/cluster/charts/rook-ceph/values.yaml
index f9b87b695..cf193d641 100644
--- a/cluster/charts/rook-ceph/values.yaml
+++ b/cluster/charts/rook-ceph/values.yaml
@@ -94,7 +94,7 @@ csi:
   #rbdLivenessMetricsPort: 9080
   #kubeletDirPath: /var/lib/kubelet
   #cephcsi:
-    #image: quay.io/cephcsi/cephcsi:v2.0.1
+    #image: quay.io/cephcsi/cephcsi:v2.1.0
   #registrar:
     #image: quay.io/k8scsi/csi-node-driver-registrar:v1.2.0
   #provisioner:
diff --git a/cluster/examples/kubernetes/ceph/operator-openshift.yaml b/cluster/examples/kubernetes/ceph/operator-openshift.yaml
index 3f005edc6..93159d4b5 100644
--- a/cluster/examples/kubernetes/ceph/operator-openshift.yaml
+++ b/cluster/examples/kubernetes/ceph/operator-openshift.yaml
@@ -122,7 +122,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:v2.0.1"
+  # ROOK_CSI_CEPH_IMAGE: "quay.io/cephcsi/cephcsi:v2.1.0"
   # ROOK_CSI_REGISTRAR_IMAGE: "quay.io/k8scsi/csi-node-driver-registrar:v1.2.0"
   # ROOK_CSI_RESIZER_IMAGE: "quay.io/k8scsi/csi-resizer:v0.4.0"
   # ROOK_CSI_PROVISIONER_IMAGE: "quay.io/k8scsi/csi-provisioner:v1.4.0"
diff --git a/cluster/examples/kubernetes/ceph/operator.yaml b/cluster/examples/kubernetes/ceph/operator.yaml
index 0bd1fd499..166f79303 100644
--- a/cluster/examples/kubernetes/ceph/operator.yaml
+++ b/cluster/examples/kubernetes/ceph/operator.yaml
@@ -46,7 +46,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:v2.0.1"
+  # ROOK_CSI_CEPH_IMAGE: "quay.io/cephcsi/cephcsi:v2.1.0"
   # ROOK_CSI_REGISTRAR_IMAGE: "quay.io/k8scsi/csi-node-driver-registrar:v1.2.0"
   # ROOK_CSI_RESIZER_IMAGE: "quay.io/k8scsi/csi-resizer:v0.4.0"
   # ROOK_CSI_PROVISIONER_IMAGE: "quay.io/k8scsi/csi-provisioner:v1.4.0"
diff --git a/pkg/operator/ceph/csi/spec.go b/pkg/operator/ceph/csi/spec.go
index 036fb9710..914da0900 100644
--- a/pkg/operator/ceph/csi/spec.go
+++ b/pkg/operator/ceph/csi/spec.go
@@ -98,7 +98,7 @@ var (
 // manually challenging.
 var (
 	// image names
-	DefaultCSIPluginImage   = "quay.io/cephcsi/cephcsi:v2.0.1"
+	DefaultCSIPluginImage   = "quay.io/cephcsi/cephcsi:v2.1.0"
 	DefaultRegistrarImage   = "quay.io/k8scsi/csi-node-driver-registrar:v1.2.0"
 	DefaultProvisionerImage = "quay.io/k8scsi/csi-provisioner:v1.4.0"
 	DefaultAttacherImage    = "quay.io/k8scsi/csi-attacher:v2.1.0"
diff --git a/pkg/operator/ceph/csi/version.go b/pkg/operator/ceph/csi/version.go
index c58626745..610bb261e 100644
--- a/pkg/operator/ceph/csi/version.go
+++ b/pkg/operator/ceph/csi/version.go
@@ -29,7 +29,8 @@ var (
 	minimum = CephCSIVersion{2, 0, 0}
 
 	//supportedCSIVersions are versions that rook supports
-	supportedCSIVersions = []CephCSIVersion{minimum}
+	releaseV210          = CephCSIVersion{2, 1, 0}
+	supportedCSIVersions = []CephCSIVersion{minimum, releaseV210}
 
 	// for parsing the output of `cephcsi`
 	versionCSIPattern = regexp.MustCompile(`v(\d+)\.(\d+)\.(\d+)`)


Test patch:
diff --git a/pkg/operator/ceph/csi/version_test.go b/pkg/operator/ceph/csi/version_test.go
index c33b09ba4..4b46fa472 100644
--- a/pkg/operator/ceph/csi/version_test.go
+++ b/pkg/operator/ceph/csi/version_test.go
@@ -23,33 +23,57 @@ import (
 )
 
 var (
-	testVersion            = CephCSIVersion{2, 0, 0}
-	testVersionUnsupported = CephCSIVersion{2, 1, 0}
+	testMinVersion         = CephCSIVersion{2, 0, 0}
+	testReleaseV210        = CephCSIVersion{2, 1, 0}
+	testVersionUnsupported = CephCSIVersion{2, 2, 0}
 )
 
 func TestIsAtLeast(t *testing.T) {
 	// Test version which is smaller
 	var version = CephCSIVersion{1, 40, 10}
-	ret := testVersion.isAtLeast(&version)
+	ret := testMinVersion.isAtLeast(&version)
 	assert.Equal(t, true, ret)
 
 	// Test version which is equal
-	ret = testVersion.isAtLeast(&testVersion)
+	ret = testMinVersion.isAtLeast(&testMinVersion)
 	assert.Equal(t, true, ret)
 
 	// Test version which is greater (minor)
 	version = CephCSIVersion{2, 1, 0}
-	ret = testVersion.isAtLeast(&version)
+	ret = testMinVersion.isAtLeast(&version)
 	assert.Equal(t, false, ret)
 
+	// Test version which is greater (bugfix)
+	version = CephCSIVersion{2, 2, 0}
+	ret = testMinVersion.isAtLeast(&version)
+	assert.Equal(t, false, ret)
+
+	// Test for v2.1.0
 	// Test version which is greater (bugfix)
 	version = CephCSIVersion{2, 0, 1}
-	ret = testVersion.isAtLeast(&version)
+	ret = testReleaseV210.isAtLeast(&version)
+	assert.Equal(t, true, ret)
+
+	// Test version which is equal
+	ret = testReleaseV210.isAtLeast(&testReleaseV210)
+	assert.Equal(t, true, ret)
+
+	// Test version which is greater (minor)
+	version = CephCSIVersion{2, 1, 1}
+	ret = testReleaseV210.isAtLeast(&version)
+	assert.Equal(t, false, ret)
+
+	// Test version which is greater (bugfix)
+	version = CephCSIVersion{2, 2, 0}
+	ret = testMinVersion.isAtLeast(&version)
 	assert.Equal(t, false, ret)
 }
 
 func TestSupported(t *testing.T) {
-	ret := testVersion.Supported()
+	ret := testMinVersion.Supported()
+	assert.Equal(t, true, ret)
+
+	ret = testReleaseV210.Supported()
 	assert.Equal(t, true, ret)
 
 	ret = testVersionUnsupported.Supported()