Skip to content

Commit

Permalink
upgrade to go v1.22.7 (#3046)
Browse files Browse the repository at this point in the history
  • Loading branch information
aggarwal0009 authored Oct 3, 2024
1 parent 21265a7 commit 45e58cc
Show file tree
Hide file tree
Showing 28 changed files with 78 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.203.0/containers/go/.devcontainer/base.Dockerfile

# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): 1, 1.16, 1.17, 1-bullseye, 1.16-bullseye, 1.17-bullseye, 1-buster, 1.16-buster, 1.17-buster
ARG VARIANT="1.21"
ARG VARIANT="1.22"
FROM mcr.microsoft.com/vscode/devcontainers/go:${VARIANT}

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Update the VARIANT arg to pick a version of Go: 1, 1.16, 1.17
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local arm64/Apple Silicon.
"VARIANT": "1.21-bullseye",
"VARIANT": "1.22-bullseye",
// Options
"NODE_VERSION": "none"
}
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/crdgen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ on:
workflow_dispatch:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
- opened
- reopened
- synchronize
- ready_for_review
jobs:
crdgen119:
strategy:
matrix:
go-version: ['1.21']
go-version: ["1.21", "1.22"]
os: [ubuntu-latest]
name: CRDs are Generated
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Regenerate NodeNetworkConfig CRD
run: make -C crd/nodenetworkconfig
- name: Regenerate MultitenantNetworkContainer CRD
run: make -C crd/multitenantnetworkcontainer
- name: Fail if the tree is dirty
run: test -z "$(git status --porcelain)"
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Regenerate NodeNetworkConfig CRD
run: make -C crd/nodenetworkconfig
- name: Regenerate MultitenantNetworkContainer CRD
run: make -C crd/multitenantnetworkcontainer
- name: Fail if the tree is dirty
run: test -z "$(git status --porcelain)"
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

- uses: actions/setup-go@v4
with:
go-version: "^1.21"
go-version: "^1.22"

- name: Setup Kind
uses: engineerd/[email protected]
Expand Down
25 changes: 16 additions & 9 deletions .github/workflows/cyclonus-netpol-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,34 @@ on:
- main
pull_request:
paths:
- 'npm/**'
- 'github/**'
- 'test/**'
- "npm/**"
- "github/**"
- "test/**"
schedule:
# run once a day at midnight
- cron: '0 0 * * *'
- cron: "0 0 * * *"

jobs:
cyclonus-test:
runs-on: ubuntu-latest
strategy:
matrix:
# run cyclonus tests in parallel for NPM with the given ConfigMaps
profile: [v1-default.yaml, v1-place-azure-chain-first.yaml, v2-default.yaml, v2-apply-on-need.yaml, v2-place-azure-after-kube-services.yaml]
profile:
[
v1-default.yaml,
v1-place-azure-chain-first.yaml,
v2-default.yaml,
v2-apply-on-need.yaml,
v2-place-azure-after-kube-services.yaml,
]
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-go@v4
with:
go-version: '^1.21'
go-version: "^1.22"

- name: Setup Kind
uses: engineerd/[email protected]
Expand All @@ -43,7 +50,7 @@ jobs:
- name: Make NPM image
run: |
make npm-image NPM_PLATFORM_TAG=cyclonus PLATFORM=linux/amd64 CONTAINER_BUILDER=docker BUILDX_ACTION='--load'
- name: Install Azure NPM
# set the ConfigMap based on the build matrix
# currently have to restart the daemonset because changing the ConfigMap doesn't restart NPM
Expand All @@ -54,7 +61,7 @@ jobs:
echo "Applying profile: ${{ matrix.profile }}"
kubectl apply -f ./npm/profiles/${{ matrix.profile }}
kubectl rollout restart ds azure-npm -n kube-system
- name: Check Cluster Components
run: |
sleep 10
Expand All @@ -70,7 +77,7 @@ jobs:
kubectl logs -n kube-system -l k8s-app=azure-npm --tail -1 --prefix > npm-logs_${{ matrix.profile }}.txt
mv ./test/cyclonus/cyclonus-test.txt ./cyclonus-test_${{ matrix.profile }}.txt
- name: 'Upload Logs'
- name: "Upload Logs"
uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: ["1.21.x"]
go-version: ["1.21.x", "1.22.x"]
os: [ubuntu-latest, windows-latest]
name: Lint
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
args: --timeout=25m
only-new-issues: true
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
args: --timeout=25m
only-new-issues: true
2 changes: 1 addition & 1 deletion azure-ipam/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/Azure/azure-container-networking/azure-ipam

go 1.21
go 1.22.7

require (
github.com/pkg/errors v0.9.1
Expand Down
4 changes: 2 additions & 2 deletions azure-ipam/linux.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG DROPGZ_VERSION=v0.0.12
ARG OS_VERSION
ARG OS

FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS azure-ipam
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS azure-ipam
ARG OS
ARG VERSION
WORKDIR /azure-ipam
Expand All @@ -18,7 +18,7 @@ COPY --from=azure-ipam /azure-ipam/*.conflist /payload
RUN cd /payload && sha256sum * > sum.txt
RUN gzip --verbose --best --recursive /payload && for f in /payload/*.gz; do mv -- "$f" "${f%%.gz}"; done

FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS dropgz
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS dropgz
ARG DROPGZ_VERSION
ARG OS
ARG VERSION
Expand Down
4 changes: 2 additions & 2 deletions azure-ipam/windows.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG DROPGZ_VERSION=v0.0.12
ARG OS
ARG OS_VERSION

FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS azure-ipam
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS azure-ipam
ARG OS
ARG VERSION
WORKDIR /azure-ipam
Expand All @@ -18,7 +18,7 @@ COPY --from=azure-ipam /azure-ipam/*.conflist /payload
RUN cd /payload && sha256sum * > sum.txt
RUN gzip --verbose --best --recursive /payload && for f in /payload/*.gz; do mv -- "$f" "${f%%.gz}"; done

FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS dropgz
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS dropgz
ARG DROPGZ_VERSION
ARG OS
ARG VERSION
Expand Down
2 changes: 1 addition & 1 deletion build/tools/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/Azure/azure-container-networking/build/tools

go 1.21
go 1.22.7

require (
github.com/AlekSi/gocov-xml v1.1.0
Expand Down
2 changes: 1 addition & 1 deletion cni/build/windows.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG OS_VERSION
FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS builder
FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS builder
ARG VERSION
ARG CNI_AI_PATH
ARG CNI_AI_ID
Expand Down
4 changes: 2 additions & 2 deletions cni/linux.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG DROPGZ_VERSION=v0.0.12
ARG OS_VERSION
ARG OS

FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS azure-vnet
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS azure-vnet
ARG OS
ARG VERSION
WORKDIR /azure-container-networking
Expand All @@ -23,7 +23,7 @@ COPY --from=azure-vnet /azure-container-networking/telemetry/azure-vnet-telemetr
RUN cd /payload && sha256sum * > sum.txt
RUN gzip --verbose --best --recursive /payload && for f in /payload/*.gz; do mv -- "$f" "${f%%.gz}"; done

FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS dropgz
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS dropgz
ARG DROPGZ_VERSION
ARG OS
ARG VERSION
Expand Down
4 changes: 2 additions & 2 deletions cni/windows.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG DROPGZ_VERSION=v0.0.12
ARG OS
ARG OS_VERSION

FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS azure-vnet
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS azure-vnet
ARG OS
ARG VERSION
WORKDIR /azure-container-networking
Expand All @@ -23,7 +23,7 @@ COPY --from=azure-vnet /azure-container-networking/telemetry/azure-vnet-telemetr
RUN cd /payload && sha256sum * > sum.txt
RUN gzip --verbose --best --recursive /payload && for f in /payload/*.gz; do mv -- "$f" "${f%%.gz}"; done

FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS dropgz
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS dropgz
ARG DROPGZ_VERSION
ARG OS
ARG VERSION
Expand Down
2 changes: 1 addition & 1 deletion cns/linux.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS builder
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS builder
ARG VERSION
ARG CNS_AI_PATH
ARG CNS_AI_ID
Expand Down
2 changes: 1 addition & 1 deletion cns/windows.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG OS_VERSION
FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS builder
FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS builder
ARG VERSION
ARG CNS_AI_PATH
ARG CNS_AI_ID
Expand Down
6 changes: 3 additions & 3 deletions dropgz/build/cniTest_linux.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS azure-ipam
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS azure-ipam
ARG VERSION
WORKDIR /azure-ipam
COPY ./azure-ipam .
RUN CGO_ENABLED=0 go build -a -o bin/azure-ipam -trimpath -ldflags "-X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" .

FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS azure-vnet
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS azure-vnet
ARG VERSION
WORKDIR /azure-container-networking
COPY . .
Expand All @@ -27,7 +27,7 @@ COPY --from=azure-vnet /azure-container-networking/telemetry/azure-vnet-telemetr
RUN cd pkg/embed/fs/ && sha256sum * > sum.txt
RUN gzip --verbose --best --recursive pkg/embed/fs && for f in pkg/embed/fs/*.gz; do mv -- "$f" "${f%%.gz}"; done

FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS dropgz
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS dropgz
ARG VERSION
WORKDIR /dropgz
COPY --from=compressor /dropgz .
Expand Down
4 changes: 2 additions & 2 deletions dropgz/build/cniTest_windows.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG ARCH
ARG OS_VERSION
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS azure-vnet
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS azure-vnet
ARG VERSION
WORKDIR /azure-container-networking
COPY . .
Expand All @@ -19,7 +19,7 @@ COPY --from=azure-vnet /azure-container-networking/telemetry/azure-vnet-telemetr
RUN cd pkg/embed/fs/ && sha256sum * > sum.txt
RUN gzip --verbose --best --recursive pkg/embed/fs && for f in pkg/embed/fs/*.gz; do mv -- "$f" "${f%%.gz}"; done

FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS dropgz
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS dropgz
ARG VERSION
WORKDIR /dropgz
COPY --from=compressor /dropgz .
Expand Down
2 changes: 1 addition & 1 deletion dropgz/build/linux.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ COPY --from=azure-vnet /azure-container-networking/azure-vnet-ipam pkg/embed/fs
RUN cd pkg/embed/fs/ && sha256sum * > sum.txt
RUN gzip --verbose --best --recursive pkg/embed/fs && for f in pkg/embed/fs/*.gz; do mv -- "$f" "${f%%.gz}"; done

FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS dropgz
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS dropgz
ARG VERSION
WORKDIR /dropgz
COPY --from=compressor /dropgz .
Expand Down
2 changes: 1 addition & 1 deletion dropgz/build/windows.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ COPY --from=azure-vnet /azure-container-networking/azure-vnet-telemetry.config p
RUN cd pkg/embed/fs/ && sha256sum * > sum.txt
RUN gzip --verbose --best --recursive pkg/embed/fs && for f in pkg/embed/fs/*.gz; do mv -- "$f" "${f%%.gz}"; done

FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS dropgz
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS dropgz
ARG VERSION
WORKDIR /dropgz
COPY --from=compressor /dropgz .
Expand Down
2 changes: 1 addition & 1 deletion dropgz/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/Azure/azure-container-networking/dropgz

go 1.21
go 1.22.7

require (
github.com/jsternberg/zap-logfmt v1.3.0
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/Azure/azure-container-networking

go 1.21
go 1.22.7

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1
Expand Down
2 changes: 1 addition & 1 deletion hack/toolbox/Dockerfile.windows
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build cns
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS builder
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS builder
# Build args
ARG VERSION
ARG CNS_AI_PATH
Expand Down
2 changes: 1 addition & 1 deletion hack/toolbox/server/Dockerfile.heavy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 as build
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22 as build
ADD ./ /
WORKDIR /
RUN CGO_ENABLED=0 GOOS=linux go build -o server .
Expand Down
2 changes: 1 addition & 1 deletion hack/toolbox/server/Dockerfile.lite
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 as build
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22 as build
ADD ./server/server.go /
WORKDIR /
RUN CGO_ENABLED=0 GOOS=linux go build -o server .
Expand Down
2 changes: 1 addition & 1 deletion npm/linux.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS builder
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS builder
ARG VERSION
ARG NPM_AI_PATH
ARG NPM_AI_ID
Expand Down
2 changes: 1 addition & 1 deletion npm/windows.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG OS_VERSION
FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS builder
FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS builder
ARG VERSION
ARG NPM_AI_PATH
ARG NPM_AI_ID
Expand Down
2 changes: 1 addition & 1 deletion tools/acncli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 as build
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22 as build
WORKDIR /go/src/github.com/Azure/azure-container-networking/
ARG VERSION
ADD . .
Expand Down
Loading

0 comments on commit 45e58cc

Please sign in to comment.