From 6267fe1b01d3b759db768cd9ba4cdbe7f8555613 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Thu, 24 Oct 2024 20:09:44 +0000 Subject: [PATCH] Only clean up pod filesystems if umount succeeds Signed-off-by: Brad Davidson (cherry picked from commit abfac1fbfb6b647a9bd5cf42646448ef96e299c6) Signed-off-by: Brad Davidson --- bundle/bin/rke2-killall.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bundle/bin/rke2-killall.sh b/bundle/bin/rke2-killall.sh index f9db1010cb..6f6c128c35 100755 --- a/bundle/bin/rke2-killall.sh +++ b/bundle/bin/rke2-killall.sh @@ -43,8 +43,7 @@ do_unmount_and_remove() { MOUNTS=$(printf ${MOUNTS} | grep "^$1" | sort -r) if [ -n "${MOUNTS}" ]; then set -x - umount ${MOUNTS} - rm -rf --one-file-system ${MOUNTS} + umount -- ${MOUNTS} && rm -rf --one-file-system -- ${MOUNTS} else set -x fi