Skip to content

Commit

Permalink
chore: update to go1.21
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
  • Loading branch information
rbtr authored Nov 13, 2023
1 parent 4e6cc2f commit 376c566
Show file tree
Hide file tree
Showing 24 changed files with 74 additions and 108 deletions.
28 changes: 10 additions & 18 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
# 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.20"
ARG VARIANT="1.21"
FROM mcr.microsoft.com/vscode/devcontainers/go:${VARIANT}

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends podman buildah skopeo vim fzf ripgrep

# [Optional] Uncomment the next line to use go get to install anything else you need
# RUN go get -x <your-dependency-or-tool>

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
RUN apt-get update && \
export DEBIAN_FRONTEND=noninteractive && \
apt-get -y install --no-install-recommends \
podman \
buildah \
skopeo \
vim \
fzf \
ripgrep
83 changes: 39 additions & 44 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
"build": {
"dockerfile": "Dockerfile",
"args": {
// 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.20-bullseye",
// Options
"VARIANT": "1.21-bullseye",
"NODE_VERSION": "none"
}
},
Expand All @@ -19,47 +15,46 @@
"--security-opt",
"seccomp=unconfined"
],
// Set *default* container specific settings.json values on container create.
"settings": {
"editor.formatOnSave": true,
"files.autoSave": "onFocusChange",
"files.insertFinalNewline": true,
"git.allowForcePush": true,
"git.alwaysSignOff": true,
"git.autoStash": true,
"git.autofetch": "all",
"git.branchSortOrder": "alphabetically",
"git.enableCommitSigning": true,
"git.fetchOnPull": true,
"git.pruneOnFetch": true,
"git.rebaseWhenSync": true,
"go.coverOnSave": true,
"go.coverOnSingleTest": true,
"go.coverOnSingleTestFile": true,
"go.formatTool": "gofumpt",
"go.gopath": "/go",
"go.goroot": "/usr/local/go",
"go.lintTool": "golangci-lint",
"go.testOnSave": true,
"go.toolsManagement.autoUpdate": true,
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true
"customizations": {
"codespaces": {},
"vscode": {
"settings": {
"editor.formatOnSave": true,
"files.autoSave": "onFocusChange",
"files.insertFinalNewline": true,
"git.allowForcePush": true,
"git.alwaysSignOff": true,
"git.autoStash": true,
"git.autofetch": "all",
"git.branchSortOrder": "alphabetically",
"git.enableCommitSigning": true,
"git.fetchOnPull": true,
"git.pruneOnFetch": true,
"git.rebaseWhenSync": true,
"go.coverOnSave": true,
"go.coverOnSingleTest": true,
"go.coverOnSingleTestFile": true,
"go.formatTool": "gofumpt",
"go.gopath": "/go",
"go.goroot": "/usr/local/go",
"go.lintTool": "golangci-lint",
"go.testOnSave": true,
"go.toolsManagement.autoUpdate": true,
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true
},
"extensions": [
"bierner.github-markdown-preview",
"gitHub.codespaces",
"ms-vscode-remote.vscode-remote-extensionpack",
"golang.go",
"ms-vsliveshare.vsliveshare-pack",
"redhat.vscode-yaml",
"eamodio.gitlens"
]
}
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"bierner.github-markdown-preview",
"gitHub.codespaces",
"ms-vscode-remote.vscode-remote-extensionpack",
"golang.go",
"ms-vsliveshare.vsliveshare-pack",
"redhat.vscode-yaml",
"eamodio.gitlens"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "make setup",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"features": {
"docker-in-docker": "latest",
Expand Down
21 changes: 0 additions & 21 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ updates:
directory: "/"
schedule:
interval: "daily"
assignees:
- "matmerr"
- "rbtr"
reviewers:
- "azure/azure-sdn-members"
commit-message:
Expand All @@ -17,9 +14,6 @@ updates:
directory: "/"
schedule:
interval: "daily"
assignees:
- "matmerr"
- "rbtr"
reviewers:
- "azure/azure-sdn-members"
commit-message:
Expand All @@ -29,9 +23,6 @@ updates:
directory: "/"
schedule:
interval: "daily"
assignees:
- "matmerr"
- "rbtr"
reviewers:
- "azure/azure-sdn-members"
commit-message:
Expand All @@ -40,9 +31,6 @@ updates:
directory: "/azure-ipam"
schedule:
interval: "daily"
assignees:
- "matmerr"
- "rbtr"
reviewers:
- "azure/azure-sdn-members"
commit-message:
Expand All @@ -51,9 +39,6 @@ updates:
directory: "/build/tools"
schedule:
interval: "daily"
assignees:
- "matmerr"
- "rbtr"
reviewers:
- "azure/azure-sdn-members"
commit-message:
Expand All @@ -62,17 +47,11 @@ updates:
directory: "/dropgz"
schedule:
interval: "daily"
assignees:
- "matmerr"
- "rbtr"
commit-message:
prefix: "deps"
- package-ecosystem: "gomod"
directory: "/zapai"
schedule:
interval: "daily"
assignees:
- "matmerr"
- "rbtr"
commit-message:
prefix: "deps"
2 changes: 1 addition & 1 deletion .github/workflows/crdgen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
crdgen119:
strategy:
matrix:
go-version: ['1.20']
go-version: ['1.20','1.21']
os: [ubuntu-latest]
name: CRDs are Generated
runs-on: ${{ matrix.os }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

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

- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cyclonus-netpol-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

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

- name: Setup Kind
uses: engineerd/setup-kind@v0.5.0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ on:
- synchronize
- ready_for_review
jobs:
golangci119:
golangci:
strategy:
fail-fast: false
matrix:
go-version: ["1.20.x"]
go-version: ['1.20.x','1.21.x']
os: [ubuntu-latest, windows-latest]
name: Lint
runs-on: ${{ matrix.os }}
Expand Down
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.20
go 1.21

require (
github.com/Azure/azure-container-networking v1.5.12-0.20230919193705-477200881d37
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.20
go 1.21

require (
github.com/AlekSi/gocov-xml v1.1.0
Expand Down
2 changes: 1 addition & 1 deletion cns/linux.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM mcr.microsoft.com/cbl-mariner/base/core:1.0 AS certs
RUN tdnf upgrade -y && tdnf install -y ca-certificates

FROM mcr.microsoft.com/oss/go/microsoft/golang:1.20 AS builder
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 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.20 AS builder
FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.21 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.20 AS azure-ipam
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 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.20 AS azure-vnet
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS azure-vnet
ARG VERSION
WORKDIR /azure-container-networking
COPY . .
Expand All @@ -29,7 +29,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.20 AS dropgz
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 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.20 AS azure-vnet
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.21 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.20 AS dropgz
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.21 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 @@ -36,7 +36,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.20 AS dropgz
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 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 @@ -27,7 +27,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.20 AS dropgz
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.21 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.20
go 1.21

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.20
go 1.21

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.2
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.20 AS builder
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 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.20 as build
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 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.20 as build
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 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.20 AS builder
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 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.20 AS builder
FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.21 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.20 as build
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 as build
WORKDIR /go/src/github.com/Azure/azure-container-networking/
ARG VERSION
ADD . .
Expand Down
2 changes: 1 addition & 1 deletion zapai/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/Azure/azure-container-networking/zapai

go 1.20
go 1.21

require (
github.com/jsternberg/zap-logfmt v1.3.0
Expand Down

0 comments on commit 376c566

Please sign in to comment.