From 6e6fd3d6a995e3c08880124d5223ec752f428668 Mon Sep 17 00:00:00 2001 From: Jake Hyde Date: Tue, 9 Jul 2024 16:53:02 -0400 Subject: [PATCH] Add data-dir to uninstall and killall scripts Signed-off-by: Jake Hyde --- install.sh | 10 +++++++--- install.sh.sha256sum | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index cf72346f6d5f..0666bbea4e63 100755 --- a/install.sh +++ b/install.sh @@ -760,7 +760,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 @@ -834,7 +836,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-' @@ -861,6 +863,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 @@ -894,7 +898,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} diff --git a/install.sh.sha256sum b/install.sh.sha256sum index 2a09542d1fd6..62d5ad9346fa 100644 --- a/install.sh.sha256sum +++ b/install.sh.sha256sum @@ -1 +1 @@ -2e2469498e1d6a5dcd97d0eeae342298500b27fe0768527ea8039a3295cdbce9 install.sh +493e9e3dff8d0e1172d9f0b035f235ce75fa513fdc405da2719601179c41dea4 install.sh