From c0a65a1610cc091d2de30c33924d71fcad50184e Mon Sep 17 00:00:00 2001 From: Jimmi Dyson Date: Mon, 8 Aug 2022 13:44:03 +0100 Subject: [PATCH] build: Use k8s v1.24 for tests --- Makefile | 2 +- docs/environments/kind.md | 6 +++--- scripts/create-clusters.sh | 2 +- scripts/download-binaries.sh | 2 +- scripts/download-e2e-binaries.sh | 2 +- scripts/pre-commit.sh | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 0c644ae8fd..f921a8db4d 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,7 @@ all: container hyperfed controller kubefedctl webhook e2e # Unit tests test: go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest - source <(setup-envtest use -p env 1.21.x) && \ + source <(setup-envtest use -p env 1.24.x) && \ go test $(TEST_PKGS) build: hyperfed controller kubefedctl webhook diff --git a/docs/environments/kind.md b/docs/environments/kind.md index c0a54ab37f..062efb09e6 100644 --- a/docs/environments/kind.md +++ b/docs/environments/kind.md @@ -43,17 +43,17 @@ script if you'd like to change the default: NUM_CLUSTERS= ./scripts/create-clusters.sh ``` -The `KIND_TAG` is `v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6` by default. +The `KIND_TAG` is `v1.24.2@sha256:1f0cee2282f43150b52dc7933183ed96abdcfc8d293f30ec07082495874876f1` by default. Image `kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6` is used as node docker image for booting the cluster. You can use `KIND_IMAGE` or `KIND_TAG` to specify the image as you want. ```bash -KIND_TAG=v1.19.4@sha256:796d09e217d93bed01ecf8502633e48fd806fe42f9d02fdd468b81cd4e3bd40b ./scripts/create-clusters.sh +KIND_TAG=v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6 ./scripts/create-clusters.sh ``` ```bash -KIND_IMAGE=kindest/node:v1.19.4@sha256:796d09e217d93bed01ecf8502633e48fd806fe42f9d02fdd468b81cd4e3bd40b ./scripts/create-clusters.sh +KIND_IMAGE=kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6 ./scripts/create-clusters.sh ``` ## Delete Clusters diff --git a/scripts/create-clusters.sh b/scripts/create-clusters.sh index 34e7271b9d..9972530047 100755 --- a/scripts/create-clusters.sh +++ b/scripts/create-clusters.sh @@ -25,7 +25,7 @@ set -o pipefail source "${BASH_SOURCE%/*}/util.sh" NUM_CLUSTERS="${NUM_CLUSTERS:-2}" KIND_IMAGE="${KIND_IMAGE:-}" -KIND_TAG="${KIND_TAG:-v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6}" +KIND_TAG="${KIND_TAG:-v1.24.2@sha256:1f0cee2282f43150b52dc7933183ed96abdcfc8d293f30ec07082495874876f1}" OS="$(uname)" function create-clusters() { diff --git a/scripts/download-binaries.sh b/scripts/download-binaries.sh index bca31a35cf..621a839144 100755 --- a/scripts/download-binaries.sh +++ b/scripts/download-binaries.sh @@ -50,7 +50,7 @@ curl "${curl_args}" "${kb_url}" \ | tar xzP -C "${dest_dir}" --strip-components=2 go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest -source <(setup-envtest use -p env 1.21.x) +source <(setup-envtest use -p env 1.24.x) echo "KUBEBUILDER_ASSETS is set to ${KUBEBUILDER_ASSETS}" diff --git a/scripts/download-e2e-binaries.sh b/scripts/download-e2e-binaries.sh index 0def312a79..9c9dc21f1d 100755 --- a/scripts/download-e2e-binaries.sh +++ b/scripts/download-e2e-binaries.sh @@ -36,7 +36,7 @@ mkdir -p "${dest_dir}" # kind platform="$(uname -s|tr A-Z a-z)" -kind_version="v0.11.1" +kind_version="v0.14.0" kind_path="${dest_dir}/kind" kind_url="https://github.com/kubernetes-sigs/kind/releases/download/${kind_version}/kind-${platform}-amd64" curl -fLo "${kind_path}" "${kind_url}" && chmod +x "${kind_path}" diff --git a/scripts/pre-commit.sh b/scripts/pre-commit.sh index 5378382bf1..2ff6677525 100755 --- a/scripts/pre-commit.sh +++ b/scripts/pre-commit.sh @@ -57,7 +57,7 @@ function download-dependencies() { } function run-unit-tests() { - KUBEBUILDER_ASSETS=${ROOT_DIR}/bin ${MAKE_CMD} test + ${MAKE_CMD} test } function run-e2e-tests() { @@ -188,7 +188,7 @@ run-unit-tests echo "Downloading e2e test dependencies" ./scripts/download-e2e-binaries.sh -KIND_TAG="v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6" ./scripts/create-clusters.sh +KIND_TAG="v1.24.2@sha256:1f0cee2282f43150b52dc7933183ed96abdcfc8d293f30ec07082495874876f1" ./scripts/create-clusters.sh declare -a join_cluster_list=() if [[ -z "${JOIN_CLUSTERS}" ]]; then