From 02fd069dd271ee981f80c20c0cbb308ff9cbe2bf Mon Sep 17 00:00:00 2001 From: Andrew Obuchowicz Date: Mon, 13 Nov 2023 17:50:46 -0500 Subject: [PATCH] Ensure mountpoint test doesn't cause entrypoint to fail Signed-off-by: Andrew Obuchowicz --- devspaces-udi/etc/entrypoint.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/devspaces-udi/etc/entrypoint.sh b/devspaces-udi/etc/entrypoint.sh index c14ca9b178..1c8679944f 100755 --- a/devspaces-udi/etc/entrypoint.sh +++ b/devspaces-udi/etc/entrypoint.sh @@ -125,7 +125,10 @@ fi ############################################################################# # /home/user/ will be mounted to by a PVC if persistUserHome is enabled -mountpoint -q /home/user/; HOME_USER_MOUNTED=$? +# We need to override the `set -e` from this script by ensuring the mountpoint command returns 0, +# but we also need to capture the exit code of mountpoint +HOME_USER_MOUNTED=0 +mountpoint -q /home/user/ || HOME_USER_MOUNTED=$? # This file will be created after stowing, to guard from executing stow everytime the container is started STOW_COMPLETE=/home/user/.stow_completed