From f267bf374a940ef74b5a33d40de44d1c1e8ef4cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Fr=C3=A9con?= Date: Sun, 7 Apr 2024 20:36:17 +0200 Subject: [PATCH] Add mount option only if not present --- lib/microvm.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/microvm.sh b/lib/microvm.sh index 15b8b77..4f32c72 100644 --- a/lib/microvm.sh +++ b/lib/microvm.sh @@ -161,7 +161,11 @@ microvm_run() { if [ -n "$KRUNVM_RUNNER_VOLS" ]; then while IFS= read -r mount || [ -n "$mount" ]; do if [ -n "$mount" ]; then - set -- --volume "${mount}:Z,rw" "$@" + if [ -z "$(printf %s\\n "$mount"|cut -d ':' -f 3)" ]; then + set -- --volume "${mount}:Z,rw" "$@" + else + set -- --volume "${mount}" "$@" + fi fi done <