Commit 272d03df authored by k8s-merge-robot's avatar k8s-merge-robot

Merge pull request #13491 from ZJU-SEL/tear-down-resource-before-kubedown

Auto commit by PR queue bot
parents d448c83d 442a22d1
......@@ -117,6 +117,15 @@ function clear-kubeconfig() {
echo "Cleared config for ${CONTEXT} from ${KUBECONFIG}"
}
function tear_down_alive_resources() {
local kubectl="${KUBE_ROOT}/cluster/kubectl.sh"
"${kubectl}" delete rc --all
"${kubectl}" delete pods --all
"${kubectl}" delete svc --all
"${kubectl}" delete pvc --all
}
# Gets username, password for the current-context in kubeconfig, if they exist.
# Assumed vars:
# KUBECONFIG # if unset, defaults to global
......@@ -278,3 +287,4 @@ function tars_from_version() {
exit 1
fi
}
......@@ -409,6 +409,9 @@ function provision-masterandminion() {
function kube-down {
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/cluster/ubuntu/${KUBE_CONFIG_FILE-"config-default.sh"}"
source "${KUBE_ROOT}/cluster/common.sh"
tear_down_alive_resources
ii=0
for i in ${nodes}; do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment