Skip to content

Commit b24bb91

Browse files
committed
add verify-go-directive check from core CAPI
1 parent ccd69ae commit b24bb91

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ include $(ROOT_DIR_RELATIVE)/common.mk
2121

2222
# Go
2323
GO_VERSION ?=1.24.7
24+
GO_DIRECTIVE_VERSION ?= 1.24.0
2425
GO_CONTAINER_IMAGE ?= golang:$(GO_VERSION)
2526

2627
# Directories.
@@ -329,7 +330,7 @@ modules: ## Runs go mod to ensure proper vendoring.
329330
cd $(TOOLS_DIR); go mod tidy
330331

331332
.PHONY: verify ## Verify ties together the rest of the verification targets into one target
332-
verify: verify-boilerplate verify-modules verify-gen verify-conversions verify-shellcheck verify-book-links release-manifests
333+
verify: verify-boilerplate verify-modules verify-gen verify-conversions verify-shellcheck verify-book-links release-manifests verify-go-directive
333334

334335
.PHONY: verify-boilerplate
335336
verify-boilerplate: ## Verify boilerplate
@@ -367,6 +368,12 @@ verify-gen: generate ## Verify generated files
367368
verify-container-images: ## Verify container images
368369
TRACE=$(TRACE) ./hack/verify-container-images.sh
369370

371+
.PHONY: verify-go-directive
372+
verify-go-directive:
373+
# use the core Cluster API script directly to verify the go directive matches the desired one.
374+
# ref: https://github.com/kubernetes-sigs/cluster-api/blob/v1.10.7/hack/verify-go-directive.sh
375+
curl --retry 3 -fsL https://raw.githubusercontent.com/kubernetes-sigs/cluster-api/refs/tags/v1.10.7/hack/verify-go-directive.sh | bash -s -- -g $(GO_DIRECTIVE_VERSION)
376+
370377
.PHONY: apidiff
371378
apidiff: APIDIFF_OLD_COMMIT ?= $(shell git rev-parse origin/main)
372379
apidiff: $(GO_APIDIFF) ## Check for API differences

0 commit comments

Comments
 (0)