Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .bingo/Variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ $(HELM): $(BINGO_DIR)/helm.mod
@echo "(re)installing $(GOBIN)/helm-v3.18.4"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=helm.mod -o=$(GOBIN)/helm-v3.18.4 "helm.sh/helm/v3/cmd/helm"

KIND := $(GOBIN)/kind-v0.31.0
KIND := $(GOBIN)/kind-v0.32.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.31.0"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=kind.mod -o=$(GOBIN)/kind-v0.31.0 "sigs.k8s.io/kind"
@echo "(re)installing $(GOBIN)/kind-v0.32.0"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=kind.mod -o=$(GOBIN)/kind-v0.32.0 "sigs.k8s.io/kind"

KUBE_SCORE := $(GOBIN)/kube-score-v1.20.0
$(KUBE_SCORE): $(BINGO_DIR)/kube-score.mod
Expand Down
2 changes: 1 addition & 1 deletion .bingo/kind.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.24.6

require sigs.k8s.io/kind v0.31.0
require sigs.k8s.io/kind v0.32.0
2 changes: 2 additions & 0 deletions .bingo/kind.sum
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ sigs.k8s.io/kind v0.30.0 h1:2Xi1KFEfSMm0XDcvKnUt15ZfgRPCT0OnCBbpgh8DztY=
sigs.k8s.io/kind v0.30.0/go.mod h1:FSqriGaoTPruiXWfRnUXNykF8r2t+fHtK0P0m1AbGF8=
sigs.k8s.io/kind v0.31.0 h1:UcT4nzm+YM7YEbqiAKECk+b6dsvc/HRZZu9U0FolL1g=
sigs.k8s.io/kind v0.31.0/go.mod h1:FSqriGaoTPruiXWfRnUXNykF8r2t+fHtK0P0m1AbGF8=
sigs.k8s.io/kind v0.32.0 h1:p9hscbj98u/qyrjVpjId86LI70nQmbSsipV7wCG10Xk=
sigs.k8s.io/kind v0.32.0/go.mod h1:FSqriGaoTPruiXWfRnUXNykF8r2t+fHtK0P0m1AbGF8=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
2 changes: 1 addition & 1 deletion .bingo/variables.env
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ GORELEASER="${GOBIN}/goreleaser-v2.11.2"

HELM="${GOBIN}/helm-v3.18.4"

KIND="${GOBIN}/kind-v0.31.0"
KIND="${GOBIN}/kind-v0.32.0"

KUBE_SCORE="${GOBIN}/kube-score-v1.20.0"

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tilt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
run: |
cd operator-controller
make kind-cluster
# Symlink bingo-managed kind binary so tilt can find it as 'kind'
ln -sf "$(make --no-print-directory --eval='print-kind: ; @echo $(KIND)' print-kind)" /usr/local/bin/kind
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit leery on this. However, it's a github workflow, so it won't impact someone's environment.

Is there no way to tell tilt to use kind-v0.32.0 vs kind?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tilt hardcodes exec.Command("kind", "load", ...) in its source — there's no configuration option to specify a different binary name. The symlink is CI-only and doesn't affect anyone's local environment. The alternative would be installing kind without the version suffix, but that conflicts with how bingo manages tool versions.

- name: Test Tilt
run: |
cd operator-controller
Expand Down
35 changes: 31 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,13 @@ kind-deploy-experimental: manifests
cp $(CATALOGS_MANIFEST) $(DEFAULT_CATALOG)
envsubst '$$DEFAULT_CATALOG,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh | bash -s

VALIDATE_KINDEST_NODE_SCRIPT := hack/tools/validate_kindest_node.sh

.PHONY: kind-cluster
kind-cluster: $(KIND) kind-verify-versions #EXHELP Standup a kind cluster.
kind-cluster: $(KIND) #EXHELP Standup a kind cluster.
$(eval KIND_NODE_IMAGE := $(shell K8S_VERSION=v$(K8S_VERSION) $(VALIDATE_KINDEST_NODE_SCRIPT)))
-$(KIND) delete cluster --name $(KIND_CLUSTER_NAME)
$(KIND) create cluster --name $(KIND_CLUSTER_NAME) --config $(KIND_CONFIG)
$(KIND) create cluster --name $(KIND_CLUSTER_NAME) --config $(KIND_CONFIG) --image $(KIND_NODE_IMAGE)
Comment on lines +450 to +453
$(KIND) export kubeconfig --name $(KIND_CLUSTER_NAME)
kubectl wait --for=condition=Ready nodes --all --timeout=2m

Expand All @@ -456,8 +459,32 @@ kind-clean: $(KIND) #EXHELP Delete the kind cluster.
$(KIND) delete cluster --name $(KIND_CLUSTER_NAME)

.PHONY: kind-verify-versions
kind-verify-versions: $(KIND)
env K8S_VERSION=v$(K8S_VERSION) KIND=$(KIND) GOBIN=$(GOBIN) hack/tools/validate_kindest_node.sh
kind-verify-versions:
@K8S_VERSION=v$(K8S_VERSION) $(VALIDATE_KINDEST_NODE_SCRIPT) > /dev/null

.PHONY: kind-update-images
kind-update-images: $(KIND) #EXHELP Regenerate the kindest/node image map in validate_kindest_node.sh.
@KIND_VER=$$($(KIND) version | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+'); \
if [ -z "$$KIND_VER" ]; then echo "Error: could not determine kind version." >&2; exit 1; fi; \
echo "Fetching kindest/node images for kind $$KIND_VER..."; \
IMAGES=$$(curl -sfL "https://api.github.com/repos/kubernetes-sigs/kind/releases/tags/$$KIND_VER" \
| grep -oE 'kindest/node:v[0-9]+\.[0-9]+\.[0-9]+' | sort -u); \
if [ -z "$$IMAGES" ]; then echo "Error: no kindest/node images found for kind $$KIND_VER." >&2; exit 1; fi; \
CONTENT=$$(<$(VALIDATE_KINDEST_NODE_SCRIPT)); \
Comment on lines +467 to +473
Copy link
Copy Markdown
Contributor

@tmshort tmshort Jun 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know a number of people use macOS for their development platform, so you may want to consider addressing this comment. Right now, only linux users could update the SHAs

This appears to be the case (tested on macOS Tahoe)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — this has been addressed in the latest push: replaced sort -uV with sort -u and gh api with plain curl -sfL. Both are portable across Linux and macOS.

echo "$$CONTENT" | awk -v ver="$$KIND_VER" -v images="$$IMAGES" \
'BEGIN{in_block=0} \
/^# --- BEGIN KIND IMAGES ---/{print; in_block=1; \
print "# kind " ver; \
print "case \"$${K8S_MINOR}\" in"; \
n=split(images,a,"\n"); \
for(i=1;i<=n;i++){if(a[i]=="")continue; \
minor=a[i]; sub(/.*:v/,"",minor); sub(/\.[0-9]+$$/,"",minor); \
print " " minor ") IMAGE=\"" a[i] "\" ;;"}; \
print " *) IMAGE=\"\" ;;"; \
print "esac"; next} \
/^# --- END KIND IMAGES ---/{in_block=0; print; next} \
in_block{next} \
{print}' > $(VALIDATE_KINDEST_NODE_SCRIPT)
Comment on lines +473 to +487


#SECTION Build
Expand Down
44 changes: 21 additions & 23 deletions hack/tools/validate_kindest_node.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
#!/bin/bash
# This script verifies that the version of kind used for testing uses a major.minor version of k8s that operator-controller does
set -euo pipefail
# Outputs the kindest/node image for the given K8S_VERSION.
# The KIND_IMAGES block below is regenerated by `make kind-update-images`.

# Extract the version of kind, by removing the "${GOBIN}/kind-" prefix
KIND=${KIND#${GOBIN}/kind-}

GOMODCACHE=$(go env GOMODCACHE)

REGEX='v[0-9]+\.[0-9]+'

# Get the version of the image from the local kind build
if [ -d "${GOMODCACHE}" ]; then
KIND_VER=$(grep -Eo "${REGEX}" ${GOMODCACHE}/sigs.k8s.io/kind@${KIND}/pkg/apis/config/defaults/image.go)
if [ -z "${K8S_VERSION:-}" ]; then
echo "Error: K8S_VERSION is not set." >&2
exit 1
fi

# Get the version of the image from github
if [ -z "${KIND_VER}" ]; then
KIND_VER=$(curl -L -s https://github.com/kubernetes-sigs/kind/raw/refs/tags/${KIND}/pkg/apis/config/defaults/image.go | grep -Eo "${REGEX}")
fi
K8S_MINOR=$(echo "${K8S_VERSION}" | sed -E 's/^v?([0-9]+\.[0-9]+).*/\1/')

if [ -z "${KIND_VER}" ]; then
echo "Unable to determine kindest/node version"
exit 1
fi
# --- BEGIN KIND IMAGES ---
# kind v0.32.0
case "${K8S_MINOR}" in
1.33) IMAGE="kindest/node:v1.33.12" ;;
1.34) IMAGE="kindest/node:v1.34.8" ;;
1.35) IMAGE="kindest/node:v1.35.5" ;;
1.36) IMAGE="kindest/node:v1.36.1" ;;
*) IMAGE="" ;;
esac
# --- END KIND IMAGES ---

# Compare the versions
if [ "${KIND_VER}" != "${K8S_VERSION}" ]; then
echo "kindest/node:${KIND_VER} version does not match k8s ${K8S_VERSION}"
if [ -z "${IMAGE}" ]; then
echo "Error: no kindest/node image for k8s ${K8S_MINOR}." >&2
echo "Run 'make kind-update-images' after bumping kind." >&2
exit 1
fi
exit 0
echo "${IMAGE}"
Loading