Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add data-dir to uninstall and killall scripts #10473

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,9 @@ create_killall() {
#!/bin/sh
[ $(id -u) -eq 0 ] || exec sudo $0 $@

for bin in /var/lib/rancher/k3s/data/**/bin/; do
K3S_DATA_DIR=${K3S_DATA_DIR:-/var/lib/rancher/k3s}

for bin in ${K3S_DATA_DIR}/data/**/bin/; do
[ -d $bin ] && export PATH=$PATH:$bin:$bin/aux
done

Expand Down Expand Up @@ -841,7 +843,7 @@ do_unmount_and_remove() {
}

do_unmount_and_remove '/run/k3s'
do_unmount_and_remove '/var/lib/rancher/k3s'
do_unmount_and_remove "${K3S_DATA_DIR}"
do_unmount_and_remove '/var/lib/kubelet/pods'
do_unmount_and_remove '/var/lib/kubelet/plugins'
do_unmount_and_remove '/run/netns/cni-'
Expand All @@ -868,6 +870,8 @@ create_uninstall() {
set -x
[ \$(id -u) -eq 0 ] || exec sudo \$0 \$@

K3S_DATA_DIR=\${K3S_DATA_DIR:-/var/lib/rancher/k3s}

${KILLALL_K3S_SH}

if command -v systemctl; then
Expand Down Expand Up @@ -901,7 +905,7 @@ done
rm -rf /etc/rancher/k3s
rm -rf /run/k3s
rm -rf /run/flannel
rm -rf /var/lib/rancher/k3s
rm -rf \${K3S_DATA_DIR}
rm -rf /var/lib/kubelet
rm -f ${BIN_DIR}/k3s
rm -f ${KILLALL_K3S_SH}
Expand Down
2 changes: 1 addition & 1 deletion install.sh.sha256sum
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a5a95f60c57049a1d4eb11953e60d80f5f7e2fae4c7865959da669b48a44e668 install.sh
937085bbac8e3b55209739762e05c2c1006c4f4fe65dba01908f3544dc47da27 install.sh
Loading