Skip to content

Commit 806cdd1

Browse files
authored
Merge pull request #1116 from auroq/main
Ensure nerdctl script exits with failure code when Rancher Desktop is not running
2 parents e6c9fe5 + 2c87288 commit 806cdd1

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

resources/darwin/bin/nerdctl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ scriptdir="$(cd "$(dirname "${scriptname}")" && pwd)"
99

1010
if ! LIMA_HOME="$HOME/Library/Application Support/rancher-desktop/lima" "${scriptdir}/../lima/bin/limactl" ls --json | grep '"name":"0"' | grep -q '"status":"Running"'; then
1111
echo "Rancher Desktop is not running. Please start Rancher Desktop to use nerdctl";
12+
exit 1
1213
else
1314
LIMA_HOME="$HOME/Library/Application Support/rancher-desktop/lima" "${scriptdir}/../lima/bin/limactl" shell 0 sudo --preserve-env=CONTAINERD_ADDRESS nerdctl "$@"
1415
fi

resources/linux/bin/nerdctl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ else
1212

1313
if ! LIMA_HOME="${limaloc}/lima" "${scriptdir}/../lima/bin/limactl" ls --json | grep '"name":"0"' | grep -q '"status":"Running"'; then
1414
echo "Rancher Desktop is not running. Please start Rancher Desktop to use nerdctl";
15+
exit 1
1516
else
1617
LIMA_HOME="${limaloc}/lima" "${scriptdir}/../lima/bin/limactl" shell 0 sudo --preserve-env=CONTAINERD_ADDRESS nerdctl "$@"
1718
fi

0 commit comments

Comments
 (0)