Skip to content

Commit

Permalink
Merge pull request #3474 from bobbypage/bump-golang-122
Browse files Browse the repository at this point in the history
Bump golang to 1.22
  • Loading branch information
bobbypage committed Feb 26, 2024
2 parents 51d8705 + e04a4ea commit 00724be
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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"
Expand Down
11 changes: 5 additions & 6 deletions build/integration-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 && \
Expand All @@ -72,5 +71,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"
2 changes: 1 addition & 1 deletion build/unit-in-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
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.20
FROM golang:1.22
MAINTAINER dashpole@google.com

RUN apt-get update && apt-get install -y git dmsetup && apt-get clean
Expand Down

0 comments on commit 00724be

Please sign in to comment.