From 744c3b25e53a6e4fbaf928c8e0bc531bae258a29 Mon Sep 17 00:00:00 2001 From: zhangzujian Date: Tue, 21 May 2024 09:46:12 +0000 Subject: [PATCH] kill ovn-controller/ovsdb-server/ovs-vswitchd manully Signed-off-by: zhangzujian --- dist/images/start-ovs.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dist/images/start-ovs.sh b/dist/images/start-ovs.sh index 9228332cb73b..e4a096e2ebc1 100755 --- a/dist/images/start-ovs.sh +++ b/dist/images/start-ovs.sh @@ -53,6 +53,7 @@ function cgroup_match { } function quit { + set -x gen_name=$(kubectl -n "${POD_NAMESPACE}" get pod "${POD_NAME}" -o jsonpath='{.metadata.generateName}') revision_hash=$(kubectl -n "${POD_NAMESPACE}" get pod "${POD_NAME}" -o jsonpath='{.metadata.labels.controller-revision-hash}') revision=$(kubectl -n "${POD_NAMESPACE}" get controllerrevision "${gen_name}${revision_hash}" --ignore-not-found -o jsonpath='{.revision}') @@ -74,6 +75,11 @@ function quit { if cgroup_match "${pid}" self; then /usr/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server stop fi + # kill ovn-controller/ovsdb-server/ovs-vswitchd manully on cleanup/uninstallation + for pid in `pidof -c monitor`; do + pkill -P $pid + kill $pid + done fi exit 0