From a2b1f5184b3d67a578022feb8709f620ce9918ad Mon Sep 17 00:00:00 2001 From: David Porter Date: Mon, 26 Feb 2024 15:01:43 -0800 Subject: [PATCH 1/2] Bump golang to 1.22 * Also bump golang ci 1.56.2 Signed-off-by: David Porter --- .github/workflows/test.yml | 5 +++-- Makefile | 4 ++-- build/integration-in-docker.sh | 2 +- build/unit-in-container.sh | 2 +- deploy/canary/Dockerfile | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d7906df2a2..997b94f2e9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,7 @@ jobs: test: strategy: matrix: - go-versions: ['1.20', '1.19'] + go-versions: ['1.22', '1.21'] platform: [ubuntu-20.04] environment-variables: [build/config/plain.sh, build/config/libpfm4.sh, build/config/libipmctl.sh] runs-on: ${{ matrix.platform }} @@ -14,6 +14,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-versions }} + check-latest: true - name: Checkout code uses: actions/checkout@v4 - name: Run presubmit checks @@ -30,7 +31,7 @@ jobs: test-integration: strategy: matrix: - go-versions: ['1.20', '1.19'] + go-versions: ['1.22', '1.21'] platform: [ubuntu-20.04] environment-variables: [build/config/plain.sh, build/config/libpfm4.sh, build/config/libipmctl.sh] runs-on: ${{ matrix.platform }} diff --git a/Makefile b/Makefile index 1f9bb550eb..c304bae362 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ # limitations under the License. GO := go -GOLANGCI_VER := v1.54.1 +GOLANGCI_VER := v1.56.2 GO_TEST ?= $(GO) test $(or $(GO_FLAGS),-race) arch ?= $(shell go env GOARCH) @@ -72,7 +72,7 @@ docker-%: @docker build -t cadvisor:$(shell git rev-parse --short HEAD) -f deploy/Dockerfile . docker-build: - @docker run --rm -w /go/src/github.com/google/cadvisor -v ${PWD}:/go/src/github.com/google/cadvisor golang:1.20 make build + @docker run --rm -w /go/src/github.com/google/cadvisor -v ${PWD}:/go/src/github.com/google/cadvisor golang:1.22 make build presubmit: lint @echo ">> checking go mod tidy" diff --git a/build/integration-in-docker.sh b/build/integration-in-docker.sh index ece6cf6a1a..61ce17d0e5 100755 --- a/build/integration-in-docker.sh +++ b/build/integration-in-docker.sh @@ -72,5 +72,5 @@ GO_FLAGS=${GO_FLAGS:-"-tags=netgo -race"} PACKAGES=${PACKAGES:-"sudo"} BUILD_PACKAGES=${BUILD_PACKAGES:-} CADVISOR_ARGS=${CADVISOR_ARGS:-} -GOLANG_VERSION=${GOLANG_VERSION:-"1.20"} +GOLANG_VERSION=${GOLANG_VERSION:-"1.22"} run_tests "$GO_FLAGS" "$PACKAGES" "$BUILD_PACKAGES" "$CADVISOR_ARGS" diff --git a/build/unit-in-container.sh b/build/unit-in-container.sh index ceef5a4cdd..a47517533a 100755 --- a/build/unit-in-container.sh +++ b/build/unit-in-container.sh @@ -40,5 +40,5 @@ function run_tests() { GO_FLAGS=${GO_FLAGS:-"-tags=netgo -race"} BUILD_PACKAGES=${BUILD_PACKAGES:-} -GOLANG_VERSION=${GOLANG_VERSION:-"1.20"} +GOLANG_VERSION=${GOLANG_VERSION:-"1.22"} run_tests diff --git a/deploy/canary/Dockerfile b/deploy/canary/Dockerfile index 2ac3767ba7..9d8c1fd5f9 100644 --- a/deploy/canary/Dockerfile +++ b/deploy/canary/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.20 +FROM golang:1.22 MAINTAINER dashpole@google.com RUN apt-get update && apt-get install -y git dmsetup && apt-get clean From e04a4ea383a6ce9de8e8423e7dd4eaacb14b9c78 Mon Sep 17 00:00:00 2001 From: David Porter Date: Mon, 26 Feb 2024 15:11:10 -0800 Subject: [PATCH 2/2] Bump to bullseye Signed-off-by: David Porter --- build/integration-in-docker.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build/integration-in-docker.sh b/build/integration-in-docker.sh index 61ce17d0e5..662c58a766 100755 --- a/build/integration-in-docker.sh +++ b/build/integration-in-docker.sh @@ -36,15 +36,13 @@ function run_tests() { env GOOS=linux GOFLAGS='$GO_FLAGS' go test -c github.com/google/cadvisor/integration/tests/healthz" if [ "$BUILD_PACKAGES" != "" ]; then - BUILD_CMD="echo 'deb http://deb.debian.org/debian buster-backports main'>/etc/apt/sources.list.d/buster.list && \ - apt update && \ - apt install -y -t buster-backports $BUILD_PACKAGES && \ + BUILD_CMD="apt update && apt install -y $BUILD_PACKAGES && \ $BUILD_CMD" fi docker run --rm \ -w /go/src/github.com/google/cadvisor \ -v ${PWD}:/go/src/github.com/google/cadvisor \ - golang:"$GOLANG_VERSION-buster" \ + golang:"$GOLANG_VERSION-bullseye" \ bash -c "$BUILD_CMD" EXTRA_DOCKER_OPTS="-e DOCKER_IN_DOCKER_ENABLED=true" @@ -61,7 +59,8 @@ function run_tests() { --cap-add="sys_admin" \ --entrypoint="" \ gcr.io/k8s-testimages/bootstrap \ - bash -c "echo 'deb http://deb.debian.org/debian buster-backports main'>/etc/apt/sources.list.d/buster.list && \ + bash -c "export DEBIAN_FRONTEND=noninteractive && \ + echo 'deb http://deb.debian.org/debian buster-backports main'>/etc/apt/sources.list.d/buster.list && \ cat /etc/apt/sources.list.d/buster.list && \ apt update && \ apt install -y -t buster-backports $PACKAGES && \