Skip to content

Commit

Permalink
Merge pull request #2929 from bobbypage/go_1_17
Browse files Browse the repository at this point in the history
Bump golang to 1.17
  • Loading branch information
bobbypage authored Aug 26, 2021
2 parents 85796f1 + 042972f commit 84be953
Show file tree
Hide file tree
Showing 25 changed files with 29 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions build/boilerplate/boilerplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build/integration-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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
Expand Up @@ -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
Expand Down
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
Expand Down
1 change: 1 addition & 0 deletions fs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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.
Expand Down
1 change: 1 addition & 0 deletions machine/operatingsystem_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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.
Expand Down
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.
Expand Down
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.
Expand Down
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.
Expand Down
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.
Expand Down
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.
Expand Down
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.
Expand Down
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.
Expand Down
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.
Expand Down
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.
Expand Down
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.
Expand Down
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.
Expand Down
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.
Expand Down
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.
Expand Down
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.
Expand Down

0 comments on commit 84be953

Please sign in to comment.