Skip to content

Commit 67e640d

Browse files
committed
ci: update Go version to 1.25 in GitHub Actions workflows
Update Go version from 1.24 to 1.25 across all build configurations: - GitHub Actions workflows (test.yml, release-binaries.yml) - Dockerfiles (deploy/Dockerfile, deploy/canary/Dockerfile) - Build scripts (integration-in-docker.sh, unit-in-container.sh) - Makefile docker-build target - cmd/go.mod toolchain directive Also update golangci-lint from v1.64.5 to v2.6.2 for Go 1.25 compatibility, and migrate .golangci.yml to v2 format with appropriate exclusions for pre-existing code style issues. Signed-off-by: Davanum Srinivas <davanum@gmail.com>
1 parent 8d16d26 commit 67e640d

File tree

10 files changed

+67
-33
lines changed

10 files changed

+67
-33
lines changed

.github/workflows/release-binaries.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
# Create a Docker container with the appropriate architecture
5050
docker run --rm -v ${PWD}:/go/src/github.com/google/cadvisor \
5151
--platform linux/${{ matrix.arch }} \
52-
golang:1.24 \
52+
golang:1.25 \
5353
/bin/bash -c "cd /go/src/github.com/google/cadvisor && GOARCH=${{ matrix.arch }} OUTPUT_NAME_WITH_ARCH=true VERSION=${{ env.VERSION }} GO_FLAGS='-buildvcs=false -tags=netgo' ./build/build.sh"
5454
5555
- name: Generate SHA256 checksums

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
test:
55
strategy:
66
matrix:
7-
go-versions: ['1.24']
7+
go-versions: ['1.25']
88
platform: [ubuntu-22.04]
99
environment-variables: [build/config/plain.sh, build/config/libpfm4.sh, build/config/libipmctl.sh]
1010
runs-on: ${{ matrix.platform }}
@@ -31,7 +31,7 @@ jobs:
3131
test-integration:
3232
strategy:
3333
matrix:
34-
go-versions: ['1.24']
34+
go-versions: ['1.25']
3535
platform: [ubuntu-22.04]
3636
environment-variables: [build/config/plain.sh, build/config/libpfm4.sh, build/config/libipmctl.sh]
3737
runs-on: ${{ matrix.platform }}

.golangci.yml

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,58 @@
1+
version: "2"
2+
13
run:
24
timeout: 5m
3-
linters-settings:
4-
govet:
5-
enable-all: true
6-
gofmt:
7-
simplify: true
8-
goimports:
9-
local-prefixes: github.com/google/cadvisor
5+
106
linters:
11-
disable-all: true
7+
default: none
128
enable:
139
- govet
1410
- errcheck
1511
- staticcheck
1612
- unused
17-
- gosimple
1813
- ineffassign
19-
- typecheck
14+
settings:
15+
govet:
16+
disable:
17+
- fieldalignment
18+
- buildtag # old +build lines still present alongside //go:build
19+
errcheck:
20+
exclude-functions:
21+
- (io.Closer).Close
22+
- (net.Conn).Close
23+
- (*os.File).Close
24+
- (net/http.ResponseWriter).Write
25+
- os.Remove
26+
- os.RemoveAll
27+
- os.Setenv
28+
- fmt.Fprint
29+
- fmt.Fprintf
30+
- fmt.Fprintln
31+
- syscall.Close
32+
staticcheck:
33+
checks:
34+
- "all"
35+
- "-ST*" # disable all style checks (ST1000, ST1003, ST1005, etc.)
36+
- "-QF*" # disable all quickfix suggestions
37+
exclusions:
38+
rules:
39+
# Exclude errcheck in test files for cleaner test code
40+
- linters:
41+
- errcheck
42+
path: "_test\\.go$"
43+
# Exclude errcheck for Close() calls on any type
44+
- linters:
45+
- errcheck
46+
text: "Error return value of .*.Close.* is not checked"
47+
# Exclude govet printf check false positives
48+
- linters:
49+
- govet
50+
text: "printf: non-constant format string"
51+
52+
formatters:
53+
enable:
2054
- gofmt
21-
- goimports
55+
2256
issues:
2357
max-issues-per-linter: 0
2458
max-same-issues: 0

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
GO := go
16-
GOLANGCI_VER := 1.64.5
16+
GOLANGCI_VER := 2.6.2
1717
GO_TEST ?= $(GO) test $(or $(GO_FLAGS),-race)
1818
arch ?= $(shell go env GOARCH)
1919

@@ -72,7 +72,7 @@ docker-%:
7272
@docker build -t cadvisor:$(shell git rev-parse --short HEAD) -f deploy/Dockerfile .
7373

7474
docker-build:
75-
@docker run --rm -w /go/src/github.com/google/cadvisor -v ${PWD}:/go/src/github.com/google/cadvisor golang:1.23 make build
75+
@docker run --rm -w /go/src/github.com/google/cadvisor -v ${PWD}:/go/src/github.com/google/cadvisor golang:1.25 make build
7676

7777
presubmit: lint
7878
@echo ">> checking go mod tidy"

build/integration-in-docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,5 @@ GO_FLAGS=${GO_FLAGS:-"-tags=netgo -race"}
6969
PACKAGES=${PACKAGES:-"sudo"}
7070
BUILD_PACKAGES=${BUILD_PACKAGES:-}
7171
CADVISOR_ARGS=${CADVISOR_ARGS:-}
72-
GOLANG_VERSION=${GOLANG_VERSION:-"1.24"}
72+
GOLANG_VERSION=${GOLANG_VERSION:-"1.25"}
7373
run_tests

build/unit-in-container.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ function run_tests() {
4040

4141
GO_FLAGS=${GO_FLAGS:-"-tags=netgo -race"}
4242
BUILD_PACKAGES=${BUILD_PACKAGES:-}
43-
GOLANG_VERSION=${GOLANG_VERSION:-"1.24"}
43+
GOLANG_VERSION=${GOLANG_VERSION:-"1.25"}
4444
run_tests

cmd/go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/google/cadvisor/cmd
22

33
go 1.23.0
44

5-
toolchain go1.24.0
5+
toolchain go1.25.5
66

77
// Record that the cmd module requires the cadvisor library module.
88
// The github.com/google/cadvisor/cmd module is built using the Makefile
@@ -63,10 +63,10 @@ require (
6363
github.com/containerd/ttrpc v1.2.7 // indirect
6464
github.com/containerd/typeurl/v2 v2.2.3 // indirect
6565
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
66-
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
66+
github.com/cyphar/filepath-securejoin v0.5.1 // indirect
6767
github.com/davecgh/go-spew v1.1.1 // indirect
6868
github.com/distribution/reference v0.6.0 // indirect
69-
github.com/docker/docker v28.2.2+incompatible // indirect
69+
github.com/docker/docker v28.3.3+incompatible // indirect
7070
github.com/docker/go-connections v0.5.0 // indirect
7171
github.com/docker/go-units v0.5.0 // indirect
7272
github.com/eapache/go-resiliency v1.7.0 // indirect
@@ -100,10 +100,10 @@ require (
100100
github.com/moby/sys/sequential v0.6.0 // indirect
101101
github.com/moby/sys/userns v0.1.0 // indirect
102102
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
103-
github.com/opencontainers/cgroups v0.0.2 // indirect
103+
github.com/opencontainers/cgroups v0.0.4 // indirect
104104
github.com/opencontainers/go-digest v1.0.0 // indirect
105105
github.com/opencontainers/image-spec v1.1.1 // indirect
106-
github.com/opencontainers/runc v1.3.0 // indirect
106+
github.com/opencontainers/runc v1.3.3 // indirect
107107
github.com/opencontainers/runtime-spec v1.2.1 // indirect
108108
github.com/pierrec/lz4/v4 v4.1.22 // indirect
109109
github.com/pkg/errors v0.9.1 // indirect

cmd/go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ github.com/containerd/typeurl/v2 v2.2.3 h1:yNA/94zxWdvYACdYO8zofhrTVuQY73fFU1y++
7272
github.com/containerd/typeurl/v2 v2.2.3/go.mod h1:95ljDnPfD3bAbDJRugOiShd/DlAAsxGtUBhJxIn7SCk=
7373
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
7474
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
75-
github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s=
76-
github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI=
75+
github.com/cyphar/filepath-securejoin v0.5.1 h1:eYgfMq5yryL4fbWfkLpFFy2ukSELzaJOTaUTuh+oF48=
76+
github.com/cyphar/filepath-securejoin v0.5.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI=
7777
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7878
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
7979
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
8080
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
8181
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
82-
github.com/docker/docker v28.2.2+incompatible h1:CjwRSksz8Yo4+RmQ339Dp/D2tGO5JxwYeqtMOEe0LDw=
83-
github.com/docker/docker v28.2.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
82+
github.com/docker/docker v28.3.3+incompatible h1:Dypm25kh4rmk49v1eiVbsAtpAsYURjYkaKubwuBdxEI=
83+
github.com/docker/docker v28.3.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
8484
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
8585
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
8686
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
@@ -220,14 +220,14 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
220220
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
221221
github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E=
222222
github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM=
223-
github.com/opencontainers/cgroups v0.0.2 h1:A+mAPPMfgKNCEZUUtibESFx06uvhAmvo8sSz3Abwk7o=
224-
github.com/opencontainers/cgroups v0.0.2/go.mod h1:s8lktyhlGUqM7OSRL5P7eAW6Wb+kWPNvt4qvVfzA5vs=
223+
github.com/opencontainers/cgroups v0.0.4 h1:XVj8P/IHVms/j+7eh8ggdkTLAxjz84ZzuFyGoE28DR4=
224+
github.com/opencontainers/cgroups v0.0.4/go.mod h1:s8lktyhlGUqM7OSRL5P7eAW6Wb+kWPNvt4qvVfzA5vs=
225225
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
226226
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
227227
github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
228228
github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
229-
github.com/opencontainers/runc v1.3.0 h1:cvP7xbEvD0QQAs0nZKLzkVog2OPZhI/V2w3WmTmUSXI=
230-
github.com/opencontainers/runc v1.3.0/go.mod h1:9wbWt42gV+KRxKRVVugNP6D5+PQciRbenB4fLVsqGPs=
229+
github.com/opencontainers/runc v1.3.3 h1:qlmBbbhu+yY0QM7jqfuat7M1H3/iXjju3VkP9lkFQr4=
230+
github.com/opencontainers/runc v1.3.3/go.mod h1:D7rL72gfWxVs9cJ2/AayxB0Hlvn9g0gaF1R7uunumSI=
231231
github.com/opencontainers/runtime-spec v1.2.1 h1:S4k4ryNgEpxW1dzyqffOmhI1BHYcjzU8lpJfSlR0xww=
232232
github.com/opencontainers/runtime-spec v1.2.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
233233
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=

deploy/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.hub.docker.com/library/golang:1.24-alpine3.22 AS build
1+
FROM registry.hub.docker.com/library/golang:1.25-alpine3.22 AS build
22

33
# Install build depdencies for all supported arches
44
RUN apk --no-cache add bash build-base cmake device-mapper findutils git \

deploy/canary/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.24
1+
FROM golang:1.25
22
MAINTAINER dashpole@google.com
33

44
RUN apt-get update && apt-get install -y git dmsetup && apt-get clean

0 commit comments

Comments
 (0)