Skip to content

Commit bac7021

Browse files
authored
Merge pull request #21933 from medyagh/fix_update_golang
ci: Fix update golang and golint
2 parents 71d0c7e + 3286644 commit bac7021

File tree

6 files changed

+16
-12
lines changed

6 files changed

+16
-12
lines changed

Makefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download
7474

7575
# latest from https://github.com/golangci/golangci-lint/releases
7676
# update this only by running `make update-golint-version`
77-
GOLINT_VERSION ?= v2.1.6
77+
GOLINT_VERSION ?= v2.6.2
7878
# see https://golangci-lint.run/docs/configuration/file/ for config details
79-
GOLINT_CONFIG ?= .golangci.yaml
79+
GOLINT_CONFIG ?= .golangci.min.yaml
8080
# Set this to --verbose to see details about the linters and formatters used
8181
GOLINT_VERBOSE ?=
8282
# Limit number of default jobs, to avoid the CI builds running out of memory
@@ -523,15 +523,16 @@ out/linters/golangci-lint-$(GOLINT_VERSION):
523523
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
524524
lint:
525525
docker run --rm -v `pwd`:/app:Z -w /app golangci/golangci-lint:$(GOLINT_VERSION) \
526-
golangci-lint run ${GOLINT_OPTIONS} ./..."
527-
# --skip-dirs "cmd/drivers/kvm|cmd/drivers/hyperkit|pkg/drivers/kvm|pkg/drivers/hyperkit"
528-
# The "--skip-dirs" parameter is no longer supported in the V2 version. If you need to skip the directory,
529-
# add it under "linters.settings.exclusions.paths" in the ".golangci.yaml" file.
526+
./out/linters/golangci-lint-$(GOLINT_VERSION) run ${GOLINT_OPTIONS} ./...
530527
else
531528
lint: out/linters/golangci-lint-$(GOLINT_VERSION) ## Run lint
532529
./out/linters/golangci-lint-$(GOLINT_VERSION) run ${GOLINT_OPTIONS} ./...
533530
endif
534531

532+
.PHONY: lint-max
533+
lint-max: out/linters/golangci-lint-$(GOLINT_VERSION) ## Run lint
534+
./out/linters/golangci-lint-$(GOLINT_VERSION) run ${GOLINT_OPTIONS} --config .golangci.max.yaml ./...
535+
535536
# lint-ci is slower version of lint and is meant to be used in ci (travis) to avoid out of memory leaks.
536537
.PHONY: lint-ci
537538
lint-ci: out/linters/golangci-lint-$(GOLINT_VERSION) ## Run lint-ci

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ module k8s.io/minikube
22

33
go 1.24.0
44

5-
toolchain go1.24.1
6-
75
require (
86
cloud.google.com/go/storage v1.56.1
97
github.com/Delta456/box-cli-maker/v2 v2.3.0

hack/go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ module k8s.io/minikube/hack
22

33
go 1.24.0
44

5-
toolchain go1.24.1
6-
75
replace github.com/docker/machine => github.com/minikube-machine/machine v0.0.0-20240815173309-ffb6b643c381
86

97
require (

hack/prow/common.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ function install_dependencies() {
6868
brew install pstree coreutils pidof
6969
ln -s /usr/local/bin/gtimeout /usr/local/bin/timeout || true
7070
fi
71+
# do NOT change manually - only using make update-golang-version
72+
GOLANG_VERSION_TO_INSTALL="1.24.6"
7173
# install golang if not present
72-
sudo hack/prow/installer/check_install_golang.sh /usr/local 1.24.5 || true
74+
sudo -E hack/prow/installer/check_install_golang.sh /usr/local $GOLANG_VERSION_TO_INSTALL || true
7375
# install gotestsum if not present
7476
GOROOT="/usr/local/go" hack/prow/installer/check_install_gotestsum.sh || true
7577
# install gopogh

hack/update/golang_version/golang_version.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ var (
5353
`VERSION_TO_INSTALL=.*`: `VERSION_TO_INSTALL={{.StableVersion}}`,
5454
},
5555
},
56+
"hack/prow/common.sh": {
57+
Replace: map[string]string{
58+
`GOLANG_VERSION_TO_INSTALL=.*`: `GOLANG_VERSION_TO_INSTALL={{.StableVersion}}`,
59+
},
60+
},
5661
"hack/jenkins/installers/check_install_golang.ps1": {
5762
Replace: map[string]string{
5863
`GoVersion = ".*"`: `GoVersion = "{{.StableVersion}}"`,

hack/update/golint_version/golint_version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var (
3434
schema = map[string]update.Item{
3535
"Makefile": {
3636
Replace: map[string]string{
37-
`GOLINT_VERSION \?= v1.*`: `GOLINT_VERSION ?= {{.StableVersion}}`,
37+
`GOLINT_VERSION \?= v2.*`: `GOLINT_VERSION ?= {{.StableVersion}}`,
3838
},
3939
},
4040
}

0 commit comments

Comments
 (0)