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 <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2019-11-20 17:19:43 +05:30 committed by mergify[bot]
parent b1efb36b38
commit d590434374

View File

@ -44,16 +44,26 @@ func removeCephCSIResource() {
e2elog.Logf("failed to delete cephfs daemonset %v", err) e2elog.Logf("failed to delete cephfs daemonset %v", err)
} }
// cleanup rbd and cephfs statefulset deployed by rook // if kube version is <1.14.0 rook deploys cephfs and rbd provisioner as statefulset
_, err = framework.RunKubectl("delete", "-nrook-ceph", "statefulset", "csi-rbdplugin-provisioner") _, err = framework.RunKubectl("delete", "--ignore-not-found", "-nrook-ceph", "statefulset", "csi-rbdplugin-provisioner")
if err != nil { if err != nil {
e2elog.Logf("failed to delete rbd statefulset %v", err) 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 { if err != nil {
e2elog.Logf("failed to delete cephfs statefulset %v", err) 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 // cleanup rbd cluster roles deployed by rook
rbdPath := fmt.Sprintf("%s/%s/", rbdDirPath, "v1.13") rbdPath := fmt.Sprintf("%s/%s/", rbdDirPath, "v1.13")
_, err = framework.RunKubectl("delete", "--ignore-not-found", "-f", rbdPath+rbdProvisionerRBAC) _, err = framework.RunKubectl("delete", "--ignore-not-found", "-f", rbdPath+rbdProvisionerRBAC)