mirror of https://github.com/k3s-io/k3s
Merge pull request #13491 from ZJU-SEL/tear-down-resource-before-kubedown
Auto commit by PR queue botpull/6/head
commit
272d03dfa1
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -410,6 +410,9 @@ 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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue