Unverified Commit a7bf00bb authored by Brian Downs's avatar Brian Downs Committed by GitHub

Update uninstall script to remove mount point path after umount (#2542)

* update uninstall script to remove mount point path after umount
parent eb3e4c15
...@@ -606,14 +606,17 @@ getshims() { ...@@ -606,14 +606,17 @@ getshims() {
killtree $({ set +x; } 2>/dev/null; getshims; set -x) killtree $({ set +x; } 2>/dev/null; getshims; set -x)
do_unmount() { do_unmount_and_remove() {
awk -v path="$1" '$2 ~ ("^" path) { print $2 }' /proc/self/mounts | sort -r | xargs -r -t -n 1 umount awk -v path="$1" '$2 ~ ("^" path) { print $2 }' /proc/self/mounts | sort -r | xargs -r -t -n 1 sh -c 'umount "$0" && rm -rf "$0"'
} }
do_unmount '/run/k3s' do_unmount_and_remove '/run/k3s'
do_unmount '/var/lib/rancher/k3s' do_unmount_and_remove '/var/lib/rancher/k3s'
do_unmount '/var/lib/kubelet/pods' do_unmount_and_remove '/var/lib/kubelet/pods'
do_unmount '/run/netns/cni-' do_unmount_and_remove '/run/netns/cni-'
# Remove CNI namespaces
ip netns show 2>/dev/null | grep cni- | xargs -r -t -n 1 ip netns delete
# Delete network interface(s) that match 'master cni0' # Delete network interface(s) that match 'master cni0'
ip link show 2>/dev/null | grep 'master cni0' | while read ignore iface ignore; do ip link show 2>/dev/null | grep 'master cni0' | while read ignore iface ignore; 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