diff --git a/Makefile b/Makefile index 299e1f03af20..fdb2b9ca4a10 100644 --- a/Makefile +++ b/Makefile @@ -1300,7 +1300,8 @@ $(GOLANGCI_LINT_BIN): $(GOLANGCI_LINT) ## Build a local copy of golangci-lint. $(GOVULNCHECK_BIN): $(GOVULNCHECK) ## Build a local copy of govulncheck. $(CONTROLLER_GEN): # Build controller-gen from tools folder. - GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(CONTROLLER_GEN_PKG) $(CONTROLLER_GEN_BIN) $(CONTROLLER_GEN_VER) + # controller-gen 0.13 cannot be built with Go >= 1.22. We have to pin it to 1.21. + GOTOOLCHAIN=go1.21.11 GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(CONTROLLER_GEN_PKG) $(CONTROLLER_GEN_BIN) $(CONTROLLER_GEN_VER) ## We are forcing a rebuilt of conversion-gen via PHONY so that we're always using an up-to-date version. ## We can't use a versioned name for the binary, because that would be reflected in generated files.