mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 08:17:26 +00:00
Jenkins: Clean up even if we can't bring cluster up
We're gathering all the cluster logs, go ahead and clean up the resources.
This commit is contained in:
parent
759f11bd4c
commit
d1dadf70f4
@ -139,11 +139,21 @@ function install_google_cloud_sdk_tarball() {
|
|||||||
export PATH=${install_dir}/google-cloud-sdk/bin:${PATH}
|
export PATH=${install_dir}/google-cloud-sdk/bin:${PATH}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Only call after attempting to bring the cluster up. Don't call after
|
||||||
|
# bringing the cluster down.
|
||||||
function dump_cluster_logs_and_exit() {
|
function dump_cluster_logs_and_exit() {
|
||||||
local -r exit_status=$?
|
local -r exit_status=$?
|
||||||
if [[ -x "cluster/log-dump.sh" ]]; then
|
if [[ -x "cluster/log-dump.sh" ]]; then
|
||||||
./cluster/log-dump.sh "${ARTIFACTS}"
|
./cluster/log-dump.sh "${ARTIFACTS}"
|
||||||
fi
|
fi
|
||||||
|
if [[ "${E2E_DOWN,,}" == "true" ]]; then
|
||||||
|
# If we tried to bring the cluster up, make a courtesy attempt
|
||||||
|
# to bring the cluster down so we're not leaving resources
|
||||||
|
# around. Unlike later, don't sleep beforehand, though. (We're
|
||||||
|
# just trying to tear down as many resources as we can as fast
|
||||||
|
# as possible and don't even know if we brought the master up.)
|
||||||
|
go run ./hack/e2e.go ${E2E_OPT:-} -v --down || true
|
||||||
|
fi
|
||||||
exit ${exit_status}
|
exit ${exit_status}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user