From 537dce924f03b0605d0b95cda2a9c5a4e5a4cae7 Mon Sep 17 00:00:00 2001 From: David Grove Date: Wed, 17 May 2023 16:20:47 -0400 Subject: [PATCH] support multiple kind versions; add kind 0.19.0 Signed-off-by: David Grove --- ci/setup.sh | 4 ++-- scripts/kind-start.sh | 40 +++++++++++++++++++++++++++------------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/ci/setup.sh b/ci/setup.sh index faffe0cc..a0ee0147 100755 --- a/ci/setup.sh +++ b/ci/setup.sh @@ -17,8 +17,8 @@ set -eu HELM_VERSION=v3.11.2 -KIND_VERSION=v0.18.0 -KUBECTL_VERSION=v1.24.7 +KIND_VERSION=v0.19.0 +KUBECTL_VERSION=v1.24.13 # Download and install command line tools pushd /tmp diff --git a/scripts/kind-start.sh b/scripts/kind-start.sh index a52291a4..e5abdbe7 100755 --- a/scripts/kind-start.sh +++ b/scripts/kind-start.sh @@ -20,8 +20,19 @@ # controller on it. This enables services running on the cluster to be # exposed by creating Ingress instances. -# kind version that matches below tags -KIND_EXPECTED_VERSION=v0.18.0 +set -eu + +SCRIPTDIR=$(cd $(dirname "$0") && pwd) +ROOTDIR="$SCRIPTDIR/.." + +# Valid node tags for kind 0.19.0 +# 1.27: kindest/node:v1.27.1@sha256:b7d12ed662b873bd8510879c1846e87c7e676a79fefc93e17b2a52989d3ff42b +# 1.26: kindest/node:v1.26.4@sha256:f4c0d87be03d6bea69f5e5dc0adb678bb498a190ee5c38422bf751541cebe92e +# 1.25: kindest/node:v1.25.9@sha256:c08d6c52820aa42e533b70bce0c2901183326d86dcdcbedecc9343681db45161 +# 1.24: kindest/node:v1.24.13@sha256:cea86276e698af043af20143f4bf0509e730ec34ed3b7fa790cc0bea091bc5dd +# 1.23: kindest/node:v1.23.17@sha256:f77f8cf0b30430ca4128cc7cfafece0c274a118cd0cdb251049664ace0dee4ff +# 1.22: kindest/node:v1.22.17@sha256:9af784f45a584f6b28bce2af84c494d947a05bd709151466489008f80a9ce9d5 +# 1.21: kindest/node:v1.21.14@sha256:220cfafdf6e3915fbce50e13d1655425558cb98872c53f802605aa2fb2d569cf # Valid node tags for kind 0.18.0 # 1.26: kindest/node:v1.26.3@sha256:61b92f38dff6ccc29969e7aa154d34e38b89443af1a2c14e6cfbd2df6419c66f @@ -40,19 +51,22 @@ KIND_EXPECTED_VERSION=v0.18.0 # 1.20: kindest/node:v1.20.15@sha256:a32bf55309294120616886b5338f95dd98a2f7231519c7dedcec32ba29699394 # 1.19: kindest/node:v1.19.16@sha256:476cb3269232888437b61deca013832fee41f9f074f9bed79f57e4280f7c48b7 -KIND_NODE_TAG=${KIND_NODE_TAG:="v1.24.12@sha256:1e12918b8bc3d4253bc08f640a231bb0d3b2c5a9b28aa3f2ca1aee93e1e8db16"} - -set -eu - -SCRIPTDIR=$(cd $(dirname "$0") && pwd) -ROOTDIR="$SCRIPTDIR/.." - -# Validate kind version is as expected +# Based on the kind version found in the path, select the correct Kubernetes 1.24 node tag KIND_ACTUAL_VERSION=$(kind version | awk '/ /{print $2}') -if [ "$KIND_ACTUAL_VERSION" != "$KIND_EXPECTED_VERSION" ]; then - echo "Kind version mismatch: expected $KIND_EXPECTED_VERSION but found $KIND_ACTUAL_VERSION" +case $KIND_ACTUAL_VERSION in + v0.19.0) + KIND_NODE_TAG=${KIND_NODE_TAG:="v1.24.13@sha256:cea86276e698af043af20143f4bf0509e730ec34ed3b7fa790cc0bea091bc5dd"} + ;; + v0.18.0) + KIND_NODE_TAG=${KIND_NODE_TAG:="v1.24.12@sha256:1e12918b8bc3d4253bc08f640a231bb0d3b2c5a9b28aa3f2ca1aee93e1e8db16"} + ;; + v0.17.0) + KIND_NODE_TAG=${KIND_NODE_TAG:="v1.24.7@sha256:577c630ce8e509131eab1aea12c022190978dd2f745aac5eb1fe65c0807eb315"} + ;; + *) + echo "Unexpected kind version: $KIND_ACTUAL_VERSION" exit 1 -fi +esac # create docker network "kind" so that rootless podman can connect registry docker network create kind >/dev/null || true