diff --git a/Makefile b/Makefile index 7955dbf2775e..e9344042d551 100644 --- a/Makefile +++ b/Makefile @@ -74,9 +74,9 @@ 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 +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,15 +523,16 @@ 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 ${GOLINT_OPTIONS} ./... else lint: out/linters/golangci-lint-$(GOLINT_VERSION) ## Run lint ./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 ${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 diff --git a/go.mod b/go.mod index c8c4e1dd6d11..b9169532a477 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,6 @@ module k8s.io/minikube go 1.24.0 -toolchain go1.24.1 - 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 842d598df6c3..9aea15d8b29b 100644 --- a/hack/go.mod +++ b/hack/go.mod @@ -2,8 +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 require ( diff --git a/hack/prow/common.sh b/hack/prow/common.sh index db1d71dd0922..4cc37fdf1b54 100755 --- a/hack/prow/common.sh +++ b/hack/prow/common.sh @@ -68,8 +68,10 @@ 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 # install gopogh 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}}"`, 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}}`, }, }, }