From 0f9c262eda1aa756ddc31e9bd9276fa708c57616 Mon Sep 17 00:00:00 2001 From: RainbowMango Date: Tue, 7 Jan 2020 15:21:24 +0800 Subject: [PATCH] Cleanup cloud controller manager when closing cluster. --- hack/local-up-cluster.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index b97d6058b51..5a77035040b 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -349,6 +349,10 @@ cleanup() [[ -n "${CTLRMGR_PID-}" ]] && kube::util::read-array CTLRMGR_PIDS < <(pgrep -P "${CTLRMGR_PID}" ; ps -o pid= -p "${CTLRMGR_PID}") [[ -n "${CTLRMGR_PIDS-}" ]] && sudo kill "${CTLRMGR_PIDS[@]}" 2>/dev/null + # Check if the cloud-controller-manager is still running + [[ -n "${CLOUD_CTLRMGR_PID-}" ]] && kube::util::read-array CLOUD_CTLRMGR_PIDS < <(pgrep -P "${CLOUD_CTLRMGR_PID}" ; ps -o pid= -p "${CLOUD_CTLRMGR_PID}") + [[ -n "${CLOUD_CTLRMGR_PIDS-}" ]] && sudo kill "${CLOUD_CTLRMGR_PIDS[@]}" 2>/dev/null + # Check if the kubelet is still running [[ -n "${KUBELET_PID-}" ]] && kube::util::read-array KUBELET_PIDS < <(pgrep -P "${KUBELET_PID}" ; ps -o pid= -p "${KUBELET_PID}") [[ -n "${KUBELET_PIDS-}" ]] && sudo kill "${KUBELET_PIDS[@]}" 2>/dev/null