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

Auto commit by PR queue bot
pull/6/head
k8s-merge-robot 2015-09-07 12:04:51 -07:00
commit 272d03dfa1
2 changed files with 13 additions and 0 deletions

View File

@ -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
}

View File

@ -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