From d5904343745a4bdffacf255b4f29dda81a6ae706 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Wed, 20 Nov 2019 17:19:43 +0530 Subject: [PATCH] Delete provisioner deployment deployed by rook If kube version is == 1.13.x cephfs and rbd provisioner are deployed as statefulset and if kube version is > 1.13.x cephfs and rbd provisioner are deployed as deployment Signed-off-by: Madhu Rajanna --- e2e/e2e_test.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 4398e92e4..26b2994ce 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -44,16 +44,26 @@ func removeCephCSIResource() { e2elog.Logf("failed to delete cephfs daemonset %v", err) } - // cleanup rbd and cephfs statefulset deployed by rook - _, err = framework.RunKubectl("delete", "-nrook-ceph", "statefulset", "csi-rbdplugin-provisioner") + // if kube version is <1.14.0 rook deploys cephfs and rbd provisioner as statefulset + _, err = framework.RunKubectl("delete", "--ignore-not-found", "-nrook-ceph", "statefulset", "csi-rbdplugin-provisioner") if err != nil { e2elog.Logf("failed to delete rbd statefulset %v", err) } - _, err = framework.RunKubectl("delete", "-nrook-ceph", "statefulset", "csi-cephfsplugin-provisioner") + _, err = framework.RunKubectl("delete", "--ignore-not-found", "-nrook-ceph", "statefulset", "csi-cephfsplugin-provisioner") if err != nil { e2elog.Logf("failed to delete cephfs statefulset %v", err) } + // if kube version is >=1.14.0 rook deploys cephfs and rbd provisioner as deployment + _, err = framework.RunKubectl("delete", "--ignore-not-found", "-nrook-ceph", "deployment", "csi-rbdplugin-provisioner") + if err != nil { + e2elog.Logf("failed to delete rbd deployment %v", err) + } + _, err = framework.RunKubectl("delete", "--ignore-not-found", "-nrook-ceph", "deployment", "csi-cephfsplugin-provisioner") + if err != nil { + e2elog.Logf("failed to delete cephfs deployment %v", err) + } + // cleanup rbd cluster roles deployed by rook rbdPath := fmt.Sprintf("%s/%s/", rbdDirPath, "v1.13") _, err = framework.RunKubectl("delete", "--ignore-not-found", "-f", rbdPath+rbdProvisionerRBAC)