Skip to content

Bump golang to 1.17 #2929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.17
- name: Install golangci-lint
run: >
cd /tmp &&
@@ -33,7 +33,7 @@ jobs:
test:
strategy:
matrix:
go-versions: [1.16, 1.15]
go-versions: [1.17, 1.16]
platform: [ubuntu-20.04]
environment-variables: [build/config/plain.sh, build/config/libpfm4.sh, build/config/libipmctl.sh]
runs-on: ${{ matrix.platform }}
@@ -54,7 +54,7 @@ jobs:
test-integration:
strategy:
matrix:
go-versions: [1.16, 1.15]
go-versions: [1.17, 1.16]
platform: [ubuntu-20.04]
environment-variables: [build/config/plain.sh, build/config/libpfm4.sh, build/config/libipmctl.sh]
runs-on: ${{ matrix.platform }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ docker-%:
@docker build -t cadvisor:$(shell git rev-parse --short HEAD) -f deploy/Dockerfile$(Dockerfile_tag) .

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

presubmit: vet
@echo ">> checking go formatting"
4 changes: 2 additions & 2 deletions build/boilerplate/boilerplate.py
Original file line number Diff line number Diff line change
@@ -139,8 +139,8 @@ def get_regexs():
regexs["year"] = re.compile( 'YEAR' )
# dates can be something in the 21st century
regexs["date"] = re.compile( '20[0-9][0-9]' )
# strip // +build \n\n build constraints
regexs["go_build_constraints"] = re.compile(r"^(// \+build.*\n)+\n", re.MULTILINE)
# strip // +build \n\n build and //go:build constraints
regexs["go_build_constraints"] = re.compile(r"^(//\s*(\+build|go:build).*\n)+\n", re.MULTILINE)
# strip #!.* from shell scripts
regexs["shebang"] = re.compile(r"^(#!.*\n)\n*", re.MULTILINE)
return regexs
2 changes: 1 addition & 1 deletion build/integration-in-docker.sh
Original file line number Diff line number Diff line change
@@ -70,5 +70,5 @@ GO_FLAGS=${GO_FLAGS:-"-tags=netgo -race"}
PACKAGES=${PACKAGES:-"sudo"}
BUILD_PACKAGES=${BUILD_PACKAGES:-}
CADVISOR_ARGS=${CADVISOR_ARGS:-}
GOLANG_VERSION=${GOLANG_VERSION:-"1.16"}
GOLANG_VERSION=${GOLANG_VERSION:-"1.17"}
run_tests "$GO_FLAGS" "$PACKAGES" "$BUILD_PACKAGES" "$CADVISOR_ARGS"
2 changes: 1 addition & 1 deletion build/unit-in-container.sh
Original file line number Diff line number Diff line change
@@ -44,5 +44,5 @@ function run_tests() {

GO_FLAGS=${GO_FLAGS:-"-tags=netgo -race"}
BUILD_PACKAGES=${BUILD_PACKAGES:-}
GOLANG_VERSION=${GOLANG_VERSION:-"1.16"}
GOLANG_VERSION=${GOLANG_VERSION:-"1.17"}
run_tests
2 changes: 2 additions & 0 deletions cmd/internal/storage/influxdb/influxdb_test.go
Original file line number Diff line number Diff line change
@@ -12,7 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build influxdb_test
// +build influxdb_test

// To run unit test: go test -tags influxdb_test

package influxdb
2 changes: 1 addition & 1 deletion deploy/canary/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16
FROM golang:1.17
MAINTAINER [email protected]

RUN apt-get update && apt-get install -y git dmsetup && apt-get clean
1 change: 1 addition & 0 deletions fs/fs.go
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build linux
// +build linux

// Provides Filesystem Stats
1 change: 1 addition & 0 deletions integration/tests/api/perf_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build libpfm && cgo
// +build libpfm,cgo

// Copyright 2020 Google Inc. All Rights Reserved.
1 change: 1 addition & 0 deletions machine/operatingsystem_unix.go
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build freebsd || darwin || linux
// +build freebsd darwin linux

package machine
1 change: 1 addition & 0 deletions nvm/machine_libipmctl.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build libipmctl && cgo
// +build libipmctl,cgo

// Copyright 2020 Google Inc. All Rights Reserved.
1 change: 1 addition & 0 deletions nvm/machine_no_libipmctl.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !libipmctl || !cgo
// +build !libipmctl !cgo

// Copyright 2020 Google Inc. All Rights Reserved.
1 change: 1 addition & 0 deletions perf/collector_libpfm.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build libpfm && cgo
// +build libpfm,cgo

// Copyright 2020 Google Inc. All Rights Reserved.
1 change: 1 addition & 0 deletions perf/collector_libpfm_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build libpfm && cgo
// +build libpfm,cgo

// Copyright 2020 Google Inc. All Rights Reserved.
1 change: 1 addition & 0 deletions perf/collector_no_libpfm.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !libpfm || !cgo
// +build !libpfm !cgo

// Copyright 2020 Google Inc. All Rights Reserved.
1 change: 1 addition & 0 deletions perf/manager_libpfm.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build libpfm && cgo
// +build libpfm,cgo

// Copyright 2020 Google Inc. All Rights Reserved.
1 change: 1 addition & 0 deletions perf/manager_libpfm_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build libpfm && cgo
// +build libpfm,cgo

// Copyright 2020 Google Inc. All Rights Reserved.
1 change: 1 addition & 0 deletions perf/manager_no_libpfm.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !libpfm || !cgo
// +build !libpfm !cgo

// Copyright 2020 Google Inc. All Rights Reserved.
1 change: 1 addition & 0 deletions perf/types_libpfm.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build libpfm && cgo
// +build libpfm,cgo

// Copyright 2020 Google Inc. All Rights Reserved.
1 change: 1 addition & 0 deletions perf/uncore_libpfm.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build libpfm && cgo
// +build libpfm,cgo

// Copyright 2020 Google Inc. All Rights Reserved.
1 change: 1 addition & 0 deletions perf/uncore_libpfm_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build libpfm && cgo
// +build libpfm,cgo

// Copyright 2020 Google Inc. All Rights Reserved.
1 change: 1 addition & 0 deletions resctrl/collector.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

// Copyright 2020 Google Inc. All Rights Reserved.
1 change: 1 addition & 0 deletions resctrl/manager.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

// Copyright 2020 Google Inc. All Rights Reserved.
1 change: 1 addition & 0 deletions utils/sysfs/sysfs_notx86.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !x86
// +build !x86

// Copyright 2021 Google Inc. All Rights Reserved.
1 change: 1 addition & 0 deletions utils/sysfs/sysfs_x86.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build x86
// +build x86

// Copyright 2021 Google Inc. All Rights Reserved.