From 7c8ca55ac08123c32fa7183bf9c3b94c4fa4fa5b Mon Sep 17 00:00:00 2001 From: Chinasubbareddy Mallavarapu Date: Tue, 27 Oct 2020 22:15:52 +0000 Subject: [PATCH] [ceph-provisioners] Validate each storageclass created This is to include every storageclass getting created part of helm tests. Change-Id: I62dc11600d00fe2ec7babb1688e61d3eaa50100c --- ceph-provisioners/Chart.yaml | 2 +- ceph-provisioners/templates/bin/_helm-tests.sh.tpl | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ceph-provisioners/Chart.yaml b/ceph-provisioners/Chart.yaml index 6ba2945fc..6d5f89164 100644 --- a/ceph-provisioners/Chart.yaml +++ b/ceph-provisioners/Chart.yaml @@ -15,6 +15,6 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Ceph Provisioner name: ceph-provisioners -version: 0.1.1 +version: 0.1.2 home: https://github.com/ceph/ceph ... diff --git a/ceph-provisioners/templates/bin/_helm-tests.sh.tpl b/ceph-provisioners/templates/bin/_helm-tests.sh.tpl index 3fe919af9..72510f31a 100644 --- a/ceph-provisioners/templates/bin/_helm-tests.sh.tpl +++ b/ceph-provisioners/templates/bin/_helm-tests.sh.tpl @@ -174,19 +174,21 @@ EOF reset_test_env $PVC_NAMESPACE $RBD_TEST_POD_NAME $RBD_TEST_PVC_NAME reset_test_env $PVC_NAMESPACE $CEPHFS_TEST_POD_NAME $CEPHFS_TEST_PVC_NAME -if [ {{ .Values.storageclass.rbd.provision_storage_class }} == true ]; +{{- range $storageclass, $val := .Values.storageclass }} +if [ {{ $val.provisioner }} == "ceph.com/rbd" ] && [ {{ $val.provision_storage_class }} == true ]; then echo "--> Checking RBD storage class." - storageclass={{ .Values.storageclass.rbd.metadata.name }} + storageclass={{ $val.metadata.name }} storageclass_validation $PVC_NAMESPACE $RBD_TEST_POD_NAME $RBD_TEST_PVC_NAME $storageclass reset_test_env $PVC_NAMESPACE $RBD_TEST_POD_NAME $RBD_TEST_PVC_NAME fi -if [ {{ .Values.storageclass.cephfs.provision_storage_class }} == true ]; +if [ {{ $val.provisioner }} == "ceph.com/cephfs" ] && [ {{ $val.provision_storage_class }} == true ]; then echo "--> Checking cephfs storage class." - storageclass={{ .Values.storageclass.cephfs.metadata.name }} + storageclass={{ $val.metadata.name }} storageclass_validation $PVC_NAMESPACE $CEPHFS_TEST_POD_NAME $CEPHFS_TEST_PVC_NAME $storageclass reset_test_env $PVC_NAMESPACE $CEPHFS_TEST_POD_NAME $CEPHFS_TEST_PVC_NAME fi +{{- end }}