Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

build: Use k8s v1.24 for tests #1516

Merged
merged 1 commit into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/environments/kind.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ script if you'd like to change the default:
NUM_CLUSTERS=<num> ./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
Expand Down
2 changes: 1 addition & 1 deletion scripts/create-clusters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion scripts/download-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
jimmidyson marked this conversation as resolved.
Show resolved Hide resolved

echo "KUBEBUILDER_ASSETS is set to ${KUBEBUILDER_ASSETS}"

Expand Down
2 changes: 1 addition & 1 deletion scripts/download-e2e-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
4 changes: 2 additions & 2 deletions scripts/pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand Down