From 7403d3eab5febe16a49796b3bf091e8c92e57981 Mon Sep 17 00:00:00 2001 From: Antonio Costa Date: Thu, 18 Apr 2024 12:14:09 +0200 Subject: [PATCH] fix docker commands --- kind/kind.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/kind/kind.sh b/kind/kind.sh index bf6ee7b9..41c54589 100755 --- a/kind/kind.sh +++ b/kind/kind.sh @@ -707,6 +707,7 @@ function validate_ingress() { } function define_runtime_commands() { + note "2" "#define_runtime_commands()..." note "2" "CRI Provider: ${CRI_PROVIDER}" note "2" "Rootless: ${ROOTLESS_CONTAINERS}" note "2" "OS Type: ${OSTYPE}" @@ -715,12 +716,16 @@ function define_runtime_commands() { "linux-gnu"*) # DOCKER_RESTART_COMMAND="sudo systemctl restart docker" NETWORK_RM_CMD="${CRI_COMMAND} network rm -f kind" - if [ "${ROOTLESS_CONTAINERS}" == 'y' ]; then - CRI_COMMAND="podman" - export KIND_EXPERIMENTAL_PROVIDER=podman - else - CRI_COMMAND="sudo podman" - KIND_COMMAND="sudo --preserve-env kind" + if [ "${CRI_PROVIDER}" == 'podman' ]; then + if [ "${ROOTLESS_CONTAINERS}" == 'y' ]; then + CRI_COMMAND="podman" + export KIND_EXPERIMENTAL_PROVIDER=podman + else + CRI_COMMAND="sudo podman" + KIND_COMMAND="sudo --preserve-env kind" + fi + elif [ "${CRI_PROVIDER}" == 'docker' ]; then + CRI_COMMAND="docker" fi ;; "darwin"*)