Skip to content

Commit

Permalink
fix: shellcheck
Browse files Browse the repository at this point in the history
Signed-off-by: Lin Yang <[email protected]>
  • Loading branch information
reaver-flomesh committed Jan 6, 2025
1 parent a70a758 commit 46d45ab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/k3d-with-registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ jq_reg_running=".[] | select(.name == \"$final_reg_name\" and .State.Running ==
num_of_exists=$(k3d registry list -o json | jq "$jq_reg_exists" | jq -s 'length')
if [ "${num_of_exists}" == '0' ]; then
# no k3d managed registry found, kill any running registry container and create a new one
#shellcheck disable=SC2046
docker kill $(docker ps --format json | jq -r 'select(.Image == "registry:2" and .State == "running") | .ID')
k3d registry create "$reg_name" --port "127.0.0.1:$reg_port"
else
num_of_running=$(k3d registry list -o json | jq "$jq_reg_running" | jq -s 'length')
if [ "${num_of_running}" == '0' ]; then
k3d registry delete --all
# no k3d managed registry found, kill any running registry container and create a new one
#shellcheck disable=SC2046
docker kill $(docker ps --format json | jq -r 'select(.Image == "registry:2" and .State == "running") | .ID')
k3d registry create "$reg_name" --port "127.0.0.1:$reg_port"
fi
Expand Down

0 comments on commit 46d45ab

Please sign in to comment.