diff --git a/.bingo/Variables.mk b/.bingo/Variables.mk index 16a0e58a2..273cfb709 100644 --- a/.bingo/Variables.mk +++ b/.bingo/Variables.mk @@ -53,11 +53,11 @@ $(GORELEASER): $(BINGO_DIR)/goreleaser.mod @echo "(re)installing $(GOBIN)/goreleaser-v1.26.2" @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=goreleaser.mod -o=$(GOBIN)/goreleaser-v1.26.2 "github.com/goreleaser/goreleaser" -KIND := $(GOBIN)/kind-v0.27.0 +KIND := $(GOBIN)/kind-v0.29.0 $(KIND): $(BINGO_DIR)/kind.mod @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. - @echo "(re)installing $(GOBIN)/kind-v0.27.0" - @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=kind.mod -o=$(GOBIN)/kind-v0.27.0 "sigs.k8s.io/kind" + @echo "(re)installing $(GOBIN)/kind-v0.29.0" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=kind.mod -o=$(GOBIN)/kind-v0.29.0 "sigs.k8s.io/kind" KUSTOMIZE := $(GOBIN)/kustomize-v5.6.0 $(KUSTOMIZE): $(BINGO_DIR)/kustomize.mod diff --git a/.bingo/kind.mod b/.bingo/kind.mod index 3037dbbaa..90ef6aa18 100644 --- a/.bingo/kind.mod +++ b/.bingo/kind.mod @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT go 1.20 -require sigs.k8s.io/kind v0.27.0 +require sigs.k8s.io/kind v0.29.0 diff --git a/.bingo/kind.sum b/.bingo/kind.sum index b4115fe16..30e183508 100644 --- a/.bingo/kind.sum +++ b/.bingo/kind.sum @@ -64,6 +64,8 @@ sigs.k8s.io/kind v0.26.0 h1:8fS6I0Q5WGlmLprSpH0DarlOSdcsv0txnwc93J2BP7M= sigs.k8s.io/kind v0.26.0/go.mod h1:t7ueEpzPYJvHA8aeLtI52rtFftNgUYUaCwvxjk7phfw= sigs.k8s.io/kind v0.27.0 h1:PQ3f0iAWNIj66LYkZ1ivhEg/+Zb6UPMbO+qVei/INZA= sigs.k8s.io/kind v0.27.0/go.mod h1:RZVFmy6qcwlSWwp6xeIUv7kXCPF3i8MXsEXxW/J+gJY= +sigs.k8s.io/kind v0.29.0 h1:3TpCsyh908IkXXpcSnsMjWdwdWjIl7o9IMZImZCWFnI= +sigs.k8s.io/kind v0.29.0/go.mod h1:ldWQisw2NYyM6k64o/tkZng/1qQW7OlzcN5a8geJX3o= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= diff --git a/.bingo/variables.env b/.bingo/variables.env index 07e40961f..b773bd006 100644 --- a/.bingo/variables.env +++ b/.bingo/variables.env @@ -20,7 +20,7 @@ GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.64.6" GORELEASER="${GOBIN}/goreleaser-v1.26.2" -KIND="${GOBIN}/kind-v0.27.0" +KIND="${GOBIN}/kind-v0.29.0" KUSTOMIZE="${GOBIN}/kustomize-v5.6.0" diff --git a/Makefile b/Makefile index a576df128..acb547bbb 100644 --- a/Makefile +++ b/Makefile @@ -40,12 +40,6 @@ endif # Ensure ENVTEST_VERSION follows correct "X.Y.x" format ENVTEST_VERSION := $(K8S_VERSION).x -# 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.) -# The K8S_VERSION is set by getting the version of the k8s.io/client-go dependency from the go.mod -# and sets major version to "1" and the patch version to "0". For example, a client-go version of v0.28.5 -# will map to a K8S_VERSION of 1.28.0 -KIND_CLUSTER_IMAGE := kindest/node:v$(K8S_VERSION).0 - # Define dependency versions (use go.mod if we also use Go code from dependency) export CERT_MGR_VERSION := v1.17.1 export WAIT_TIMEOUT := 60s @@ -320,8 +314,9 @@ kind-deploy: manifests .PHONY: kind-cluster kind-cluster: $(KIND) #EXHELP Standup a kind cluster. + env K8S_VERSION=v$(K8S_VERSION) KIND=$(KIND) GOBIN=$(GOBIN) hack/tools/validate_kindest_node.sh -$(KIND) delete cluster --name $(KIND_CLUSTER_NAME) - $(KIND) create cluster --name $(KIND_CLUSTER_NAME) --image $(KIND_CLUSTER_IMAGE) --config ./kind-config.yaml + $(KIND) create cluster --name $(KIND_CLUSTER_NAME) --config ./kind-config.yaml $(KIND) export kubeconfig --name $(KIND_CLUSTER_NAME) .PHONY: kind-clean diff --git a/hack/tools/validate_kindest_node.sh b/hack/tools/validate_kindest_node.sh new file mode 100755 index 000000000..c1fdcc313 --- /dev/null +++ b/hack/tools/validate_kindest_node.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# This script verifies that the version of kind used for testing uses a major.minor version of k8s that operator-controller does + +# Extract the version of kind, by removing the "${GOBIN}/kind-" prefix +KIND=${KIND#${GOBIN}/kind-} + +# Get the version of the image +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]+') + +# Compare the versions +if [ "${KIND_VER}" != "${K8S_VERSION}" ]; then + echo "kindest/node:${KIND_VER} version does not match k8s ${K8S_VERSION}" + exit 1 +fi +exit 0