Skip to content

Commit

Permalink
Add mount option only if not present
Browse files Browse the repository at this point in the history
  • Loading branch information
efrecon committed Apr 7, 2024
1 parent 5c6c4f9 commit f267bf3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/microvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
$(printf %s\\n "$KRUNVM_RUNNER_VOLS")
Expand Down

0 comments on commit f267bf3

Please sign in to comment.