Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test] delete kind cluster after tests run #120

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion release-tools/prow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,18 @@ EOF
KUBECONFIG="$(kind get kubeconfig-path --name=csi-prow)"
export KUBECONFIG
}

# Deletes kind cluster inside a prow job
delete_cluster_inside_prow_job() {
# Inside a real Prow job it is better to clean up at runtime
# instead of leaving that to the Prow job cleanup code
# because the later sometimes times out (https://github.com/kubernetes-csi/csi-release-tools/issues/24#issuecomment-554765872).
if [ "$JOB_NAME" ]; then
if kind get clusters | grep -q csi-prow; then
run kind delete cluster --name=csi-prow || die "kind delete failed"
fi
unset KUBECONFIG
fi
}
# Looks for the deployment as specified by CSI_PROW_DEPLOYMENT and CSI_PROW_KUBERNETES_VERSION
# in the given directory.
find_deployment () {
Expand Down Expand Up @@ -1017,6 +1028,7 @@ main () {
fi
fi
fi
delete_cluster_inside_prow_job
fi

if tests_need_alpha_cluster && [ "${CSI_PROW_E2E_ALPHA_GATES}" ]; then
Expand Down Expand Up @@ -1047,6 +1059,7 @@ main () {
fi
fi
fi
delete_cluster_inside_prow_job
fi
fi

Expand Down