Skip to content

Commit 84be953

Browse files
authored
Merge pull request #2929 from bobbypage/go_1_17
Bump golang to 1.17
2 parents 85796f1 + 042972f commit 84be953

25 files changed

+29
-9
lines changed

.github/workflows/test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Install Go
1414
uses: actions/setup-go@v1
1515
with:
16-
go-version: 1.16
16+
go-version: 1.17
1717
- name: Install golangci-lint
1818
run: >
1919
cd /tmp &&
@@ -33,7 +33,7 @@ jobs:
3333
test:
3434
strategy:
3535
matrix:
36-
go-versions: [1.16, 1.15]
36+
go-versions: [1.17, 1.16]
3737
platform: [ubuntu-20.04]
3838
environment-variables: [build/config/plain.sh, build/config/libpfm4.sh, build/config/libipmctl.sh]
3939
runs-on: ${{ matrix.platform }}
@@ -54,7 +54,7 @@ jobs:
5454
test-integration:
5555
strategy:
5656
matrix:
57-
go-versions: [1.16, 1.15]
57+
go-versions: [1.17, 1.16]
5858
platform: [ubuntu-20.04]
5959
environment-variables: [build/config/plain.sh, build/config/libpfm4.sh, build/config/libipmctl.sh]
6060
runs-on: ${{ matrix.platform }}

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ docker-%:
8686
@docker build -t cadvisor:$(shell git rev-parse --short HEAD) -f deploy/Dockerfile$(Dockerfile_tag) .
8787

8888
docker-build:
89-
@docker run --rm -w /go/src/github.com/google/cadvisor -v ${PWD}:/go/src/github.com/google/cadvisor golang:1.16 make build
89+
@docker run --rm -w /go/src/github.com/google/cadvisor -v ${PWD}:/go/src/github.com/google/cadvisor golang:1.17 make build
9090

9191
presubmit: vet
9292
@echo ">> checking go formatting"

build/boilerplate/boilerplate.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ def get_regexs():
139139
regexs["year"] = re.compile( 'YEAR' )
140140
# dates can be something in the 21st century
141141
regexs["date"] = re.compile( '20[0-9][0-9]' )
142-
# strip // +build \n\n build constraints
143-
regexs["go_build_constraints"] = re.compile(r"^(// \+build.*\n)+\n", re.MULTILINE)
142+
# strip // +build \n\n build and //go:build constraints
143+
regexs["go_build_constraints"] = re.compile(r"^(//\s*(\+build|go:build).*\n)+\n", re.MULTILINE)
144144
# strip #!.* from shell scripts
145145
regexs["shebang"] = re.compile(r"^(#!.*\n)\n*", re.MULTILINE)
146146
return regexs

build/integration-in-docker.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@ GO_FLAGS=${GO_FLAGS:-"-tags=netgo -race"}
7070
PACKAGES=${PACKAGES:-"sudo"}
7171
BUILD_PACKAGES=${BUILD_PACKAGES:-}
7272
CADVISOR_ARGS=${CADVISOR_ARGS:-}
73-
GOLANG_VERSION=${GOLANG_VERSION:-"1.16"}
73+
GOLANG_VERSION=${GOLANG_VERSION:-"1.17"}
7474
run_tests "$GO_FLAGS" "$PACKAGES" "$BUILD_PACKAGES" "$CADVISOR_ARGS"

build/unit-in-container.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ function run_tests() {
4444

4545
GO_FLAGS=${GO_FLAGS:-"-tags=netgo -race"}
4646
BUILD_PACKAGES=${BUILD_PACKAGES:-}
47-
GOLANG_VERSION=${GOLANG_VERSION:-"1.16"}
47+
GOLANG_VERSION=${GOLANG_VERSION:-"1.17"}
4848
run_tests

cmd/internal/storage/influxdb/influxdb_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
//go:build influxdb_test
1516
// +build influxdb_test
17+
1618
// To run unit test: go test -tags influxdb_test
1719

1820
package influxdb

deploy/canary/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.16
1+
FROM golang:1.17
22
33

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

fs/fs.go

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
//go:build linux
1516
// +build linux
1617

1718
// Provides Filesystem Stats

integration/tests/api/perf_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build libpfm && cgo
12
// +build libpfm,cgo
23

34
// Copyright 2020 Google Inc. All Rights Reserved.

machine/operatingsystem_unix.go

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
//go:build freebsd || darwin || linux
1516
// +build freebsd darwin linux
1617

1718
package machine

nvm/machine_libipmctl.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build libipmctl && cgo
12
// +build libipmctl,cgo
23

34
// Copyright 2020 Google Inc. All Rights Reserved.

nvm/machine_no_libipmctl.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !libipmctl || !cgo
12
// +build !libipmctl !cgo
23

34
// Copyright 2020 Google Inc. All Rights Reserved.

perf/collector_libpfm.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build libpfm && cgo
12
// +build libpfm,cgo
23

34
// Copyright 2020 Google Inc. All Rights Reserved.

perf/collector_libpfm_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build libpfm && cgo
12
// +build libpfm,cgo
23

34
// Copyright 2020 Google Inc. All Rights Reserved.

perf/collector_no_libpfm.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !libpfm || !cgo
12
// +build !libpfm !cgo
23

34
// Copyright 2020 Google Inc. All Rights Reserved.

perf/manager_libpfm.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build libpfm && cgo
12
// +build libpfm,cgo
23

34
// Copyright 2020 Google Inc. All Rights Reserved.

perf/manager_libpfm_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build libpfm && cgo
12
// +build libpfm,cgo
23

34
// Copyright 2020 Google Inc. All Rights Reserved.

perf/manager_no_libpfm.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !libpfm || !cgo
12
// +build !libpfm !cgo
23

34
// Copyright 2020 Google Inc. All Rights Reserved.

perf/types_libpfm.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build libpfm && cgo
12
// +build libpfm,cgo
23

34
// Copyright 2020 Google Inc. All Rights Reserved.

perf/uncore_libpfm.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build libpfm && cgo
12
// +build libpfm,cgo
23

34
// Copyright 2020 Google Inc. All Rights Reserved.

perf/uncore_libpfm_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build libpfm && cgo
12
// +build libpfm,cgo
23

34
// Copyright 2020 Google Inc. All Rights Reserved.

resctrl/collector.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build linux
12
// +build linux
23

34
// Copyright 2020 Google Inc. All Rights Reserved.

resctrl/manager.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build linux
12
// +build linux
23

34
// Copyright 2020 Google Inc. All Rights Reserved.

utils/sysfs/sysfs_notx86.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !x86
12
// +build !x86
23

34
// Copyright 2021 Google Inc. All Rights Reserved.

utils/sysfs/sysfs_x86.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build x86
12
// +build x86
23

34
// Copyright 2021 Google Inc. All Rights Reserved.

0 commit comments

Comments
 (0)