From 9e4f46bad1dfc8d3b783f34fe233bad7517b3fae Mon Sep 17 00:00:00 2001 From: Medya Ghazizadeh Date: Wed, 19 Nov 2025 11:53:25 -0800 Subject: [PATCH 1/8] gomod remove toolchain --- go.mod | 1 - hack/go.mod | 1 - 2 files changed, 2 deletions(-) diff --git a/go.mod b/go.mod index c8c4e1dd6d11..8b8e298d92a3 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,6 @@ module k8s.io/minikube go 1.24.0 -toolchain go1.24.1 require ( cloud.google.com/go/storage v1.56.1 diff --git a/hack/go.mod b/hack/go.mod index 842d598df6c3..3bca12fdd7b2 100644 --- a/hack/go.mod +++ b/hack/go.mod @@ -2,7 +2,6 @@ module k8s.io/minikube/hack go 1.24.0 -toolchain go1.24.1 replace github.com/docker/machine => github.com/minikube-machine/machine v0.0.0-20240815173309-ffb6b643c381 From 8f1eac85bc31f5a5e18f4ce1bed9027d5ae723f2 Mon Sep 17 00:00:00 2001 From: Medya Ghazizadeh Date: Wed, 19 Nov 2025 11:55:50 -0800 Subject: [PATCH 2/8] make prow golang install configurable --- hack/prow/common.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hack/prow/common.sh b/hack/prow/common.sh index db1d71dd0922..de58527be56e 100755 --- a/hack/prow/common.sh +++ b/hack/prow/common.sh @@ -72,6 +72,8 @@ function install_dependencies() { sudo hack/prow/installer/check_install_golang.sh /usr/local 1.24.5 || true # install gotestsum if not present GOROOT="/usr/local/go" hack/prow/installer/check_install_gotestsum.sh || true + # do NOT change manually - only using make update-golang-version + GOLANG_VERSION_TO_INSTALL="1.24.6" # install gopogh hack/prow/installer/check_install_gopogh.sh || true From dcc077df6788c3d1ed85ffd81198ae19fe3afb09 Mon Sep 17 00:00:00 2001 From: Medya Ghazizadeh Date: Wed, 19 Nov 2025 11:57:32 -0800 Subject: [PATCH 3/8] make prow golang install configurable --- hack/prow/common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hack/prow/common.sh b/hack/prow/common.sh index de58527be56e..4cc37fdf1b54 100755 --- a/hack/prow/common.sh +++ b/hack/prow/common.sh @@ -68,12 +68,12 @@ function install_dependencies() { brew install pstree coreutils pidof ln -s /usr/local/bin/gtimeout /usr/local/bin/timeout || true fi + # do NOT change manually - only using make update-golang-version + GOLANG_VERSION_TO_INSTALL="1.24.6" # install golang if not present - sudo hack/prow/installer/check_install_golang.sh /usr/local 1.24.5 || true + sudo -E hack/prow/installer/check_install_golang.sh /usr/local $GOLANG_VERSION_TO_INSTALL || true # install gotestsum if not present GOROOT="/usr/local/go" hack/prow/installer/check_install_gotestsum.sh || true - # do NOT change manually - only using make update-golang-version - GOLANG_VERSION_TO_INSTALL="1.24.6" # install gopogh hack/prow/installer/check_install_gopogh.sh || true From a7094e9c84348d63007c2bf64b1a9e21ab4fa542 Mon Sep 17 00:00:00 2001 From: Medya Ghazizadeh Date: Wed, 19 Nov 2025 11:58:19 -0800 Subject: [PATCH 4/8] add prow golang to auto-updater --- hack/update/golang_version/golang_version.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hack/update/golang_version/golang_version.go b/hack/update/golang_version/golang_version.go index 47723c7235a1..a09e0bac4fad 100644 --- a/hack/update/golang_version/golang_version.go +++ b/hack/update/golang_version/golang_version.go @@ -53,6 +53,11 @@ var ( `VERSION_TO_INSTALL=.*`: `VERSION_TO_INSTALL={{.StableVersion}}`, }, }, + "hack/prow/common.sh": { + Replace: map[string]string{ + `GOLANG_VERSION_TO_INSTALL=.*`: `GOLANG_VERSION_TO_INSTALL={{.StableVersion}}`, + }, + }, "hack/jenkins/installers/check_install_golang.ps1": { Replace: map[string]string{ `GoVersion = ".*"`: `GoVersion = "{{.StableVersion}}"`, From 22af4fc41442186eaa727f1711e983e4194c1e87 Mon Sep 17 00:00:00 2001 From: Medya Ghazizadeh Date: Wed, 19 Nov 2025 12:09:53 -0800 Subject: [PATCH 5/8] fix golint not updating --- Makefile | 2 +- hack/update/golint_version/golint_version.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7955dbf2775e..e13910e0886c 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,7 @@ MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download # latest from https://github.com/golangci/golangci-lint/releases # update this only by running `make update-golint-version` -GOLINT_VERSION ?= v2.1.6 +GOLINT_VERSION ?= v2.6.2 # see https://golangci-lint.run/docs/configuration/file/ for config details GOLINT_CONFIG ?= .golangci.yaml # Set this to --verbose to see details about the linters and formatters used diff --git a/hack/update/golint_version/golint_version.go b/hack/update/golint_version/golint_version.go index 46e701ec6a08..a1e4c348ed11 100644 --- a/hack/update/golint_version/golint_version.go +++ b/hack/update/golint_version/golint_version.go @@ -34,7 +34,7 @@ var ( schema = map[string]update.Item{ "Makefile": { Replace: map[string]string{ - `GOLINT_VERSION \?= v1.*`: `GOLINT_VERSION ?= {{.StableVersion}}`, + `GOLINT_VERSION \?= v2.*`: `GOLINT_VERSION ?= {{.StableVersion}}`, }, }, } From 3155608d921554b0e1d1c87c055b753a241fcc1e Mon Sep 17 00:00:00 2001 From: Medya Ghazizadeh Date: Wed, 19 Nov 2025 12:36:57 -0800 Subject: [PATCH 6/8] change default lint to min --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e13910e0886c..f780754b8948 100644 --- a/Makefile +++ b/Makefile @@ -523,20 +523,22 @@ out/linters/golangci-lint-$(GOLINT_VERSION): ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y) lint: docker run --rm -v `pwd`:/app:Z -w /app golangci/golangci-lint:$(GOLINT_VERSION) \ - golangci-lint run ${GOLINT_OPTIONS} ./..." - # --skip-dirs "cmd/drivers/kvm|cmd/drivers/hyperkit|pkg/drivers/kvm|pkg/drivers/hyperkit" - # The "--skip-dirs" parameter is no longer supported in the V2 version. If you need to skip the directory, - # add it under "linters.settings.exclusions.paths" in the ".golangci.yaml" file. + ./out/linters/golangci-lint-$(GOLINT_VERSION) run --config .golangci.min.yaml ./... else lint: out/linters/golangci-lint-$(GOLINT_VERSION) ## Run lint - ./out/linters/golangci-lint-$(GOLINT_VERSION) run ${GOLINT_OPTIONS} ./... + ./out/linters/golangci-lint-$(GOLINT_VERSION) run --config .golangci.min.yaml ./... endif +.PHONY: lint-max +lint-max: out/linters/golangci-lint-$(GOLINT_VERSION) ## Run lint + ./out/linters/golangci-lint-$(GOLINT_VERSION) run --config .golangci.max.yaml ./... + + # lint-ci is slower version of lint and is meant to be used in ci (travis) to avoid out of memory leaks. .PHONY: lint-ci lint-ci: out/linters/golangci-lint-$(GOLINT_VERSION) ## Run lint-ci GOGC=${GOLINT_GOGC} ./out/linters/golangci-lint-$(GOLINT_VERSION) run \ - --concurrency ${GOLINT_JOBS} ${GOLINT_OPTIONS} ./... + --concurrency ${GOLINT_JOBS} --config .golangci.min.yaml ./... .PHONY: reportcard reportcard: ## Run goreportcard for minikube From be37695de1f39d8702efd8564bc0a918e15213a4 Mon Sep 17 00:00:00 2001 From: Medya Ghazizadeh Date: Wed, 19 Nov 2025 12:45:56 -0800 Subject: [PATCH 7/8] change linter to min till we fix it --- Makefile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index f780754b8948..e9344042d551 100644 --- a/Makefile +++ b/Makefile @@ -76,7 +76,7 @@ MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download # update this only by running `make update-golint-version` GOLINT_VERSION ?= v2.6.2 # see https://golangci-lint.run/docs/configuration/file/ for config details -GOLINT_CONFIG ?= .golangci.yaml +GOLINT_CONFIG ?= .golangci.min.yaml # Set this to --verbose to see details about the linters and formatters used GOLINT_VERBOSE ?= # Limit number of default jobs, to avoid the CI builds running out of memory @@ -523,22 +523,21 @@ out/linters/golangci-lint-$(GOLINT_VERSION): ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y) lint: docker run --rm -v `pwd`:/app:Z -w /app golangci/golangci-lint:$(GOLINT_VERSION) \ - ./out/linters/golangci-lint-$(GOLINT_VERSION) run --config .golangci.min.yaml ./... + ./out/linters/golangci-lint-$(GOLINT_VERSION) run ${GOLINT_OPTIONS} ./... else lint: out/linters/golangci-lint-$(GOLINT_VERSION) ## Run lint - ./out/linters/golangci-lint-$(GOLINT_VERSION) run --config .golangci.min.yaml ./... + ./out/linters/golangci-lint-$(GOLINT_VERSION) run ${GOLINT_OPTIONS} ./... endif .PHONY: lint-max lint-max: out/linters/golangci-lint-$(GOLINT_VERSION) ## Run lint - ./out/linters/golangci-lint-$(GOLINT_VERSION) run --config .golangci.max.yaml ./... - + ./out/linters/golangci-lint-$(GOLINT_VERSION) run ${GOLINT_OPTIONS} --config .golangci.max.yaml ./... # lint-ci is slower version of lint and is meant to be used in ci (travis) to avoid out of memory leaks. .PHONY: lint-ci lint-ci: out/linters/golangci-lint-$(GOLINT_VERSION) ## Run lint-ci GOGC=${GOLINT_GOGC} ./out/linters/golangci-lint-$(GOLINT_VERSION) run \ - --concurrency ${GOLINT_JOBS} --config .golangci.min.yaml ./... + --concurrency ${GOLINT_JOBS} ${GOLINT_OPTIONS} ./... .PHONY: reportcard reportcard: ## Run goreportcard for minikube From 32866444974c12a7d8ddc1fef191b1f510c102a5 Mon Sep 17 00:00:00 2001 From: Medya Ghazizadeh Date: Wed, 19 Nov 2025 13:01:02 -0800 Subject: [PATCH 8/8] gomod tid --- go.mod | 1 - hack/go.mod | 1 - 2 files changed, 2 deletions(-) diff --git a/go.mod b/go.mod index 8b8e298d92a3..b9169532a477 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,6 @@ module k8s.io/minikube go 1.24.0 - require ( cloud.google.com/go/storage v1.56.1 github.com/Delta456/box-cli-maker/v2 v2.3.0 diff --git a/hack/go.mod b/hack/go.mod index 3bca12fdd7b2..9aea15d8b29b 100644 --- a/hack/go.mod +++ b/hack/go.mod @@ -2,7 +2,6 @@ module k8s.io/minikube/hack go 1.24.0 - replace github.com/docker/machine => github.com/minikube-machine/machine v0.0.0-20240815173309-ffb6b643c381 require (