diff --git a/README.md b/README.md index 8b98acf..823bb1d 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,7 @@ Quobyte requires a secret to authenticate volume create and delete requests. Cre Create a [storage class](example/StorageClass.yaml) with the `provisioner` set to `csi.quobyte.com` along with other configuration parameters. You could create multiple storage classes by varying `parameters` such as - `quobyteTenant`, `quobyteConfig` etc. + `quobyteTenant` etc. ```bash kubectl create -f example/StorageClass.yaml diff --git a/example/Storage-class-shared-volume.yaml b/example/Storage-class-shared-volume.yaml index c6dde9e..3dcf2ca 100644 --- a/example/Storage-class-shared-volume.yaml +++ b/example/Storage-class-shared-volume.yaml @@ -33,8 +33,6 @@ parameters: # Mount secrets csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials" csi.storage.k8s.io/node-publish-secret-namespace: "quobyte" - # Quobyte volume configuration - quobyteConfig: "BASE" # creates quota for the volume if set to true. The size of the Quota # is the storage requested in PVC. If false, creates volume without size limit. createQuota: "true" diff --git a/example/StorageClass.yaml b/example/StorageClass.yaml index 21fdc4a..2eac141 100644 --- a/example/StorageClass.yaml +++ b/example/StorageClass.yaml @@ -32,8 +32,6 @@ parameters: # Mount secrets csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials" csi.storage.k8s.io/node-publish-secret-namespace: "quobyte" - # Quobyte volume configuration - quobyteConfig: "BASE" # creates quota for the volume if set to true. The size of the Quota # is the storage requested in PVC. If false, creates volume without size limit. createQuota: "true" diff --git a/kind-cluster/test-configs/local_cluster_3.x/k8s_storage_class.yaml b/kind-cluster/test-configs/local_cluster_3.x/k8s_storage_class.yaml index 4c5a9b2..711187e 100644 --- a/kind-cluster/test-configs/local_cluster_3.x/k8s_storage_class.yaml +++ b/kind-cluster/test-configs/local_cluster_3.x/k8s_storage_class.yaml @@ -31,8 +31,6 @@ parameters: # Mount secrets csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials" csi.storage.k8s.io/node-publish-secret-namespace: "quobyte" - # Quobyte volume configuration - quobyteConfig: "BASE" # creates quota for the volume if set to true. The size of the Quota # is the storage requested in PVC. If false, creates volume without size limit. createQuota: "true" diff --git a/kind-cluster/test-configs/local_cluster_3.x_accesskeys/k8s_storage_class.yaml b/kind-cluster/test-configs/local_cluster_3.x_accesskeys/k8s_storage_class.yaml index 4c5a9b2..711187e 100644 --- a/kind-cluster/test-configs/local_cluster_3.x_accesskeys/k8s_storage_class.yaml +++ b/kind-cluster/test-configs/local_cluster_3.x_accesskeys/k8s_storage_class.yaml @@ -31,8 +31,6 @@ parameters: # Mount secrets csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials" csi.storage.k8s.io/node-publish-secret-namespace: "quobyte" - # Quobyte volume configuration - quobyteConfig: "BASE" # creates quota for the volume if set to true. The size of the Quota # is the storage requested in PVC. If false, creates volume without size limit. createQuota: "true" diff --git a/kind-cluster/test-configs/local_cluster_3.x_accesskeys_2/k8s_storage_class.yaml b/kind-cluster/test-configs/local_cluster_3.x_accesskeys_2/k8s_storage_class.yaml index 7e3089f..f48f700 100644 --- a/kind-cluster/test-configs/local_cluster_3.x_accesskeys_2/k8s_storage_class.yaml +++ b/kind-cluster/test-configs/local_cluster_3.x_accesskeys_2/k8s_storage_class.yaml @@ -31,8 +31,6 @@ parameters: # Mounting requires file system/mount secrets csi.storage.k8s.io/node-publish-secret-name: "quobyte-mount-secret" csi.storage.k8s.io/node-publish-secret-namespace: "quobyte" - # Quobyte volume configuration - quobyteConfig: "BASE" # creates quota for the volume if set to true. The size of the Quota # is the storage requested in PVC. If false, creates volume without size limit. createQuota: "true" diff --git a/kind-cluster/test-configs/local_cluster_3.x_shared_volume/k8s_storage_class.yaml b/kind-cluster/test-configs/local_cluster_3.x_shared_volume/k8s_storage_class.yaml index d2c8b69..e6549dd 100644 --- a/kind-cluster/test-configs/local_cluster_3.x_shared_volume/k8s_storage_class.yaml +++ b/kind-cluster/test-configs/local_cluster_3.x_shared_volume/k8s_storage_class.yaml @@ -35,8 +35,6 @@ parameters: # Mount secrets csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials" csi.storage.k8s.io/node-publish-secret-namespace: "quobyte" - # Quobyte volume configuration - quobyteConfig: "BASE" # creates quota for the volume if set to true. The size of the Quota # is the storage requested in PVC. If false, creates volume without size limit. user: root diff --git a/kind-cluster/test-configs/local_cluster_3.x_snapshots/k8s_storage_class.yaml b/kind-cluster/test-configs/local_cluster_3.x_snapshots/k8s_storage_class.yaml index 4c5a9b2..711187e 100644 --- a/kind-cluster/test-configs/local_cluster_3.x_snapshots/k8s_storage_class.yaml +++ b/kind-cluster/test-configs/local_cluster_3.x_snapshots/k8s_storage_class.yaml @@ -31,8 +31,6 @@ parameters: # Mount secrets csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials" csi.storage.k8s.io/node-publish-secret-namespace: "quobyte" - # Quobyte volume configuration - quobyteConfig: "BASE" # creates quota for the volume if set to true. The size of the Quota # is the storage requested in PVC. If false, creates volume without size limit. createQuota: "true" diff --git a/kind-cluster/test-configs/test_3.x/k8s_storage_class.yaml b/kind-cluster/test-configs/test_3.x/k8s_storage_class.yaml index 4c5a9b2..711187e 100644 --- a/kind-cluster/test-configs/test_3.x/k8s_storage_class.yaml +++ b/kind-cluster/test-configs/test_3.x/k8s_storage_class.yaml @@ -31,8 +31,6 @@ parameters: # Mount secrets csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials" csi.storage.k8s.io/node-publish-secret-namespace: "quobyte" - # Quobyte volume configuration - quobyteConfig: "BASE" # creates quota for the volume if set to true. The size of the Quota # is the storage requested in PVC. If false, creates volume without size limit. createQuota: "true" diff --git a/kind-cluster/test-configs/test_3.x_shared_volume/k8s_storage_class.yaml b/kind-cluster/test-configs/test_3.x_shared_volume/k8s_storage_class.yaml index 758388b..edf0584 100644 --- a/kind-cluster/test-configs/test_3.x_shared_volume/k8s_storage_class.yaml +++ b/kind-cluster/test-configs/test_3.x_shared_volume/k8s_storage_class.yaml @@ -34,8 +34,6 @@ parameters: # Mount secrets csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials" csi.storage.k8s.io/node-publish-secret-namespace: "quobyte" - # Quobyte volume configuration - quobyteConfig: "BASE" # creates quota for the volume if set to true. The size of the Quota # is the storage requested in PVC. If false, creates volume without size limit. createQuota: "true" diff --git a/kind-cluster/test-configs/testing_cluster/k8s_storage_class.yaml b/kind-cluster/test-configs/testing_cluster/k8s_storage_class.yaml index d7dcb96..20b1e73 100644 --- a/kind-cluster/test-configs/testing_cluster/k8s_storage_class.yaml +++ b/kind-cluster/test-configs/testing_cluster/k8s_storage_class.yaml @@ -31,8 +31,6 @@ parameters: # Mount secrets csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials" csi.storage.k8s.io/node-publish-secret-namespace: "quobyte" - # Quobyte volume configuration - quobyteConfig: "BASE" # creates quota for the volume if set to true. The size of the Quota # is the storage requested in PVC. If false, creates volume without size limit. createQuota: "true" diff --git a/kind-cluster/test-configs/testing_cluster_shared_volume/k8s_storage_class.yaml b/kind-cluster/test-configs/testing_cluster_shared_volume/k8s_storage_class.yaml index 0807563..bf4cc2c 100644 --- a/kind-cluster/test-configs/testing_cluster_shared_volume/k8s_storage_class.yaml +++ b/kind-cluster/test-configs/testing_cluster_shared_volume/k8s_storage_class.yaml @@ -34,8 +34,6 @@ parameters: # Mount secrets csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials" csi.storage.k8s.io/node-publish-secret-namespace: "quobyte" - # Quobyte volume configuration - quobyteConfig: "BASE" # creates quota for the volume if set to true. The size of the Quota # is the storage requested in PVC. If false, creates volume without size limit. createQuota: "true" diff --git a/src/driver/controller.go b/src/driver/controller.go index bbd70e5..e2fcdd9 100644 --- a/src/driver/controller.go +++ b/src/driver/controller.go @@ -59,11 +59,13 @@ func (d *QuobyteDriver) CreateVolume(ctx context.Context, req *csi.CreateVolumeR volRequest := &quobyte.CreateVolumeRequest{} // will be overriden if shared volume name is specified in storage class volRequest.Name = dynamicVolumeName - volRequest.ConfigurationName = DefaultConfig volRequest.RootUserId = DefaultUser volRequest.RootGroupId = DefaultGroup createQuota := DefaultCreateQuota volRequest.AccessMode = DefaultAccessModes + if (d.QuobyteVersion == 2) { + volRequest.ConfigurationName = DefaultConfig + } for k, v := range params { switch strings.ToLower(k) { case "quobytetenant": @@ -75,7 +77,9 @@ func (d *QuobyteDriver) CreateVolume(ctx context.Context, req *csi.CreateVolumeR case "group": volRequest.RootGroupId = v case "quobyteconfig": - volRequest.ConfigurationName = v + if (d.QuobyteVersion == 2) { + volRequest.ConfigurationName = v + } case "createquota": createQuota = strings.ToLower(v) == "true" case "labels": diff --git a/usage-example/shared-volume/README.md b/usage-example/shared-volume/README.md index 1cecf13..a10f3c8 100644 --- a/usage-example/shared-volume/README.md +++ b/usage-example/shared-volume/README.md @@ -51,7 +51,6 @@ parameters: csi.storage.k8s.io/controller-expand-secret-namespace: "quobyte" csi.storage.k8s.io/node-publish-secret-name: "quobyte-admin-credentials" csi.storage.k8s.io/node-publish-secret-namespace: "quobyte" - quobyteConfig: "BASE" user: root group: root accessMode: "750"