Skip to content

Commit

Permalink
Fix issues with kind.sh introduced by 827de54
Browse files Browse the repository at this point in the history
* Change the condition to verify docker daemon
* Restart kind registry container if it already exists but is stopped

---------

Co-authored-by: Ryan Emerson <[email protected]>
  • Loading branch information
fax4ever and ryanemerson authored Jan 7, 2025
1 parent 827de54 commit 1d8f8d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion scripts/ci/configure-xsite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ kind delete clusters --all
# Common part for both nodes
make operator-build IMG=$IMG

if ! [ -x "$(docker -v)" ]; then
if ! command -v docker &> /dev/null; then
echo "docker not installed, trying podman"
function docker() {
podman "$@"
Expand Down
12 changes: 6 additions & 6 deletions scripts/ci/kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -o errexit
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source "${SCRIPT_DIR}/operand_common.sh"

if ! [ -x "$(docker -v)" ]; then
if ! command -v docker &> /dev/null; then
echo "docker not installed, trying podman"
function docker() {
podman "$@"
Expand All @@ -25,11 +25,11 @@ docker network create kind --subnet "${KIND_SUBNET}/16" || true
# create registry container unless it already exists
reg_name='kind-registry'
reg_port=${KIND_PORT-'5001'}
running="$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)"
if [ "${running}" != 'true' ]; then
docker run \
-d --restart=always -p "127.0.0.1:${reg_port}:5000" --name "${reg_name}" \
${DOCKER_REGISTRY_IMAGE}
reg_running="$(docker container inspect -f '{{.State.Running}}' ${reg_name} || echo 'create' | xargs)"
if [ $reg_running = "create" ]; then
docker run -d --restart=always -p "127.0.0.1:${reg_port}:5000" --name "${reg_name}" "${DOCKER_REGISTRY_IMAGE}"
elif [ $reg_running = "false" ]; then
docker container restart ${reg_name}
fi

# create a cluster with the local registry enabled in containerd
Expand Down

0 comments on commit 1d8f8d8

Please sign in to comment.