mirror of https://github.com/k3s-io/k3s.git
Update uninstall script to remove mount point path after umount (#2542)
* update uninstall script to remove mount point path after umountpull/2638/head
parent
eb3e4c154c
commit
a7bf00bb9d
15
install.sh
15
install.sh
|
@ -606,14 +606,17 @@ getshims() {
|
|||
|
||||
killtree $({ set +x; } 2>/dev/null; getshims; set -x)
|
||||
|
||||
do_unmount() {
|
||||
awk -v path="$1" '$2 ~ ("^" path) { print $2 }' /proc/self/mounts | sort -r | xargs -r -t -n 1 umount
|
||||
do_unmount_and_remove() {
|
||||
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 '/var/lib/rancher/k3s'
|
||||
do_unmount '/var/lib/kubelet/pods'
|
||||
do_unmount '/run/netns/cni-'
|
||||
do_unmount_and_remove '/run/k3s'
|
||||
do_unmount_and_remove '/var/lib/rancher/k3s'
|
||||
do_unmount_and_remove '/var/lib/kubelet/pods'
|
||||
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'
|
||||
ip link show 2>/dev/null | grep 'master cni0' | while read ignore iface ignore; do
|
||||
|
|
Loading…
Reference in New Issue