diff --git a/prow.sh b/prow.sh index 3b9621a21..a79d1b638 100755 --- a/prow.sh +++ b/prow.sh @@ -580,6 +580,14 @@ EOF export KUBECONFIG } +# Deletes kind cluster +delete_cluster() { + if kind get clusters | grep -q csi-prow; then + run kind delete cluster --name=csi-prow || die "kind delete failed" + fi + unset KUBECONFIG +} + # Looks for the deployment as specified by CSI_PROW_DEPLOYMENT and CSI_PROW_KUBERNETES_VERSION # in the given directory. find_deployment () { @@ -1017,6 +1025,7 @@ main () { fi fi fi + delete_cluster fi if tests_need_alpha_cluster && [ "${CSI_PROW_E2E_ALPHA_GATES}" ]; then @@ -1047,6 +1056,7 @@ main () { fi fi fi + delete_cluster fi fi