mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +00:00
Add a tear down option to the e2e, that just tears down the cluster
Useful for cleaning state after failed runs.
This commit is contained in:
parent
9355fae71e
commit
9f49650fba
@ -357,7 +357,8 @@ function test-teardown {
|
|||||||
--project ${PROJECT} \
|
--project ${PROJECT} \
|
||||||
--norespect_terminal_width \
|
--norespect_terminal_width \
|
||||||
--force \
|
--force \
|
||||||
${MINION_TAG}-http-alt &
|
${MINION_TAG}-http-alt
|
||||||
$(dirname $0)/../cluster/kube-down.sh > /dev/null &
|
$(dirname $0)/../cluster/kube-down.sh > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ source $(dirname $0)/../cluster/$KUBERNETES_PROVIDER/util.sh
|
|||||||
# cluster running.
|
# cluster running.
|
||||||
ALREADY_UP=${1:-0}
|
ALREADY_UP=${1:-0}
|
||||||
LEAVE_UP=${2:-0}
|
LEAVE_UP=${2:-0}
|
||||||
|
TEAR_DOWN=${3:-0}
|
||||||
|
|
||||||
HAVE_JQ=$(which jq)
|
HAVE_JQ=$(which jq)
|
||||||
if [[ -z ${HAVE_JQ} ]]; then
|
if [[ -z ${HAVE_JQ} ]]; then
|
||||||
@ -41,6 +42,11 @@ export KUBE_CONFIG_FILE="config-test.sh"
|
|||||||
export KUBE_REPO_ROOT="$(dirname $0)/.."
|
export KUBE_REPO_ROOT="$(dirname $0)/.."
|
||||||
export CLOUDCFG="${KUBE_REPO_ROOT}/cluster/kubecfg.sh -expect_version_match"
|
export CLOUDCFG="${KUBE_REPO_ROOT}/cluster/kubecfg.sh -expect_version_match"
|
||||||
|
|
||||||
|
if [[ $TEAR_DOWN -ne 0 ]]; then
|
||||||
|
trap test-teardown EXIT
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Build a release required by the test provider [if any]
|
# Build a release required by the test provider [if any]
|
||||||
test-build-release
|
test-build-release
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user