From 1e11cca29e79b721ec0c8f5e8edcbb29b7a64ced Mon Sep 17 00:00:00 2001 From: Andrew Pantuso Date: Mon, 31 Oct 2022 13:46:20 -0400 Subject: [PATCH] chore: remove unused hack scripts --- hack/determine-container-runtime.sh | 56 ----------------------------- 1 file changed, 56 deletions(-) delete mode 100644 hack/determine-container-runtime.sh diff --git a/hack/determine-container-runtime.sh b/hack/determine-container-runtime.sh deleted file mode 100644 index a91ccb44..00000000 --- a/hack/determine-container-runtime.sh +++ /dev/null @@ -1,56 +0,0 @@ -# problem 1: my user is not part of the `docker` group, thus i need `sudo kind` -# problem 2: if using podman, `sudo kind` is also needed because the kubelet cannot run in an unprivileged container -# solution: test for these conditions and set -# - $CONTAINER_COMMAND -# - $KIND_COMMAND -# - $KIND_EXPERIMENTAL_PROVIDER -# accordingly -# to override: set CONTAINER_RUNTIME to either docker or podman - -function __export_docker() { - # prepend sudo if user is not in docker group - if [[ -z "$(groups | grep docker)" ]]; then - export CONTAINER_COMMAND="sudo docker" - export KIND_COMMAND="sudo kind" - else - export CONTAINER_COMMAND="docker" - export KIND_COMMAND="kind" - fi -} - -function __export_podman() { - export KIND_EXPERIMENTAL_PROVIDER=podman - export CONTAINER_COMMAND=podman - export KIND_COMMAND="sudo --preserve-env=KIND_EXPERIMENTAL_PROVIDER kind" -} - -############################## -# SCRIPT EXECUTION STARTS HERE -############################## - -if [[ -n "${CONTAINER_RUNTIME:-}" ]]; then - echo "CONTAINER_RUNTIME is set to: $CONTAINER_RUNTIME" - echo "forcing container runtime" -else - echo "CONTAINER_RUNTIME is not set or empty" - echo "detecting container runtime" - - if [[ -f "$(command -v podman)" ]]; then - CONTAINER_RUNTIME="podman" - elif [[ -f "$(command -v docker)" ]]; then - CONTAINER_RUNTIME="docker" - fi -fi - -case "$CONTAINER_RUNTIME" in - docker) - __export_docker - ;; - podman) - __export_podman - ;; - *) - echo "Unknown container runtime: $CONTAINER_RUNTIME" - echo "Please use either docker or podman" -esac -echo