Skip to content

Commit b02314b

Browse files
authored
Update kindest/node image to v1.33.1 via kind v0.29.0 (#2047)
Rather than assuming we should use a version of kindest/node based on our version of k8s in go.mod (with a .0 patch), we check to esnure that the version kind uses is compatible with our k8s major.minor version. We discovered this problem because it appears that kindest/node:v1.33.0 has issues with some systems (e.g. Fedora). Using kindest/node:v1.33.1 fixes this issue. So, we don't want to fix a .0 patch version. We want to ensure that the kindest/node image is compatible. Also note that kind never used kindest/node:v1.33.0 as a default image, kind v0.28.0/v0.29.0 use kindest/node:v1.33.1. Signed-off-by: Todd Short <tshort@redhat.com>
1 parent 00b965c commit b02314b

File tree

6 files changed

+24
-12
lines changed

6 files changed

+24
-12
lines changed

.bingo/Variables.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ $(GORELEASER): $(BINGO_DIR)/goreleaser.mod
5353
@echo "(re)installing $(GOBIN)/goreleaser-v1.26.2"
5454
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=goreleaser.mod -o=$(GOBIN)/goreleaser-v1.26.2 "github.com/goreleaser/goreleaser"
5555

56-
KIND := $(GOBIN)/kind-v0.27.0
56+
KIND := $(GOBIN)/kind-v0.29.0
5757
$(KIND): $(BINGO_DIR)/kind.mod
5858
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
59-
@echo "(re)installing $(GOBIN)/kind-v0.27.0"
60-
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=kind.mod -o=$(GOBIN)/kind-v0.27.0 "sigs.k8s.io/kind"
59+
@echo "(re)installing $(GOBIN)/kind-v0.29.0"
60+
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=kind.mod -o=$(GOBIN)/kind-v0.29.0 "sigs.k8s.io/kind"
6161

6262
KUSTOMIZE := $(GOBIN)/kustomize-v5.6.0
6363
$(KUSTOMIZE): $(BINGO_DIR)/kustomize.mod

.bingo/kind.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
22

33
go 1.20
44

5-
require sigs.k8s.io/kind v0.27.0
5+
require sigs.k8s.io/kind v0.29.0

.bingo/kind.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ sigs.k8s.io/kind v0.26.0 h1:8fS6I0Q5WGlmLprSpH0DarlOSdcsv0txnwc93J2BP7M=
6464
sigs.k8s.io/kind v0.26.0/go.mod h1:t7ueEpzPYJvHA8aeLtI52rtFftNgUYUaCwvxjk7phfw=
6565
sigs.k8s.io/kind v0.27.0 h1:PQ3f0iAWNIj66LYkZ1ivhEg/+Zb6UPMbO+qVei/INZA=
6666
sigs.k8s.io/kind v0.27.0/go.mod h1:RZVFmy6qcwlSWwp6xeIUv7kXCPF3i8MXsEXxW/J+gJY=
67+
sigs.k8s.io/kind v0.29.0 h1:3TpCsyh908IkXXpcSnsMjWdwdWjIl7o9IMZImZCWFnI=
68+
sigs.k8s.io/kind v0.29.0/go.mod h1:ldWQisw2NYyM6k64o/tkZng/1qQW7OlzcN5a8geJX3o=
6769
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
6870
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
6971
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=

.bingo/variables.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.64.6"
2020

2121
GORELEASER="${GOBIN}/goreleaser-v1.26.2"
2222

23-
KIND="${GOBIN}/kind-v0.27.0"
23+
KIND="${GOBIN}/kind-v0.29.0"
2424

2525
KUSTOMIZE="${GOBIN}/kustomize-v5.6.0"
2626

Makefile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ endif
4040
# Ensure ENVTEST_VERSION follows correct "X.Y.x" format
4141
ENVTEST_VERSION := $(K8S_VERSION).x
4242

43-
# Not guaranteed to have patch releases available and node image tags are full versions (i.e v1.28.0 - no v1.28, v1.29, etc.)
44-
# The K8S_VERSION is set by getting the version of the k8s.io/client-go dependency from the go.mod
45-
# and sets major version to "1" and the patch version to "0". For example, a client-go version of v0.28.5
46-
# will map to a K8S_VERSION of 1.28.0
47-
KIND_CLUSTER_IMAGE := kindest/node:v$(K8S_VERSION).0
48-
4943
# Define dependency versions (use go.mod if we also use Go code from dependency)
5044
export CERT_MGR_VERSION := v1.17.1
5145
export WAIT_TIMEOUT := 60s
@@ -320,8 +314,9 @@ kind-deploy: manifests
320314

321315
.PHONY: kind-cluster
322316
kind-cluster: $(KIND) #EXHELP Standup a kind cluster.
317+
env K8S_VERSION=v$(K8S_VERSION) KIND=$(KIND) GOBIN=$(GOBIN) hack/tools/validate_kindest_node.sh
323318
-$(KIND) delete cluster --name $(KIND_CLUSTER_NAME)
324-
$(KIND) create cluster --name $(KIND_CLUSTER_NAME) --image $(KIND_CLUSTER_IMAGE) --config ./kind-config.yaml
319+
$(KIND) create cluster --name $(KIND_CLUSTER_NAME) --config ./kind-config.yaml
325320
$(KIND) export kubeconfig --name $(KIND_CLUSTER_NAME)
326321

327322
.PHONY: kind-clean

hack/tools/validate_kindest_node.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
# This script verifies that the version of kind used for testing uses a major.minor version of k8s that operator-controller does
3+
4+
# Extract the version of kind, by removing the "${GOBIN}/kind-" prefix
5+
KIND=${KIND#${GOBIN}/kind-}
6+
7+
# Get the version of the image
8+
KIND_VER=$(curl -L -s https://github.com/kubernetes-sigs/kind/raw/refs/tags/${KIND}/pkg/apis/config/defaults/image.go | grep -Eo 'v[0-9]+\.[0-9]+')
9+
10+
# Compare the versions
11+
if [ "${KIND_VER}" != "${K8S_VERSION}" ]; then
12+
echo "kindest/node:${KIND_VER} version does not match k8s ${K8S_VERSION}"
13+
exit 1
14+
fi
15+
exit 0

0 commit comments

Comments
 (0)