From 8531d9da14271166e3beb596522a1125a76e5fa2 Mon Sep 17 00:00:00 2001 From: Lan Luo Date: Fri, 11 Oct 2024 14:54:48 +0800 Subject: [PATCH] Set default values to fix InvalidDefaultArgInFrom warning Signed-off-by: Lan Luo --- build/images/Dockerfile.agent.ubuntu | 3 ++- build/images/Dockerfile.build.agent.coverage | 5 +++-- build/images/Dockerfile.build.agent.ubi | 5 +++-- build/images/Dockerfile.build.agent.ubuntu | 5 +++-- build/images/Dockerfile.build.controller.coverage | 4 ++-- build/images/Dockerfile.build.controller.ubi | 4 ++-- build/images/Dockerfile.build.controller.ubuntu | 4 ++-- build/images/Dockerfile.build.migrator | 2 +- build/images/Dockerfile.build.windows | 5 +++-- build/images/Dockerfile.simulator.build.ubuntu | 3 ++- build/images/base/Dockerfile | 3 ++- build/images/base/Dockerfile.ubi | 3 ++- build/images/codegen/Dockerfile | 3 ++- build/images/flow-aggregator/Dockerfile | 3 ++- build/images/flow-aggregator/Dockerfile.coverage | 3 ++- build/images/ovs/Dockerfile | 3 ++- build/images/ovs/Dockerfile.ubi | 6 ++++-- build/images/ovs/Dockerfile.windows | 3 ++- build/images/test/Dockerfile | 6 ++++-- multicluster/build/images/Dockerfile.build | 3 ++- multicluster/build/images/Dockerfile.build.coverage | 3 ++- 21 files changed, 49 insertions(+), 30 deletions(-) diff --git a/build/images/Dockerfile.agent.ubuntu b/build/images/Dockerfile.agent.ubuntu index 1b4bf4b0dcb..37e5e6c04aa 100644 --- a/build/images/Dockerfile.agent.ubuntu +++ b/build/images/Dockerfile.agent.ubuntu @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG BUILD_TAG +# BUILD_TAG is expected to be overridden by CI build scripts +ARG BUILD_TAG=latest FROM antrea/base-ubuntu:${BUILD_TAG} LABEL maintainer="Antrea " diff --git a/build/images/Dockerfile.build.agent.coverage b/build/images/Dockerfile.build.agent.coverage index 9a1d3735035..69f6fd811cc 100644 --- a/build/images/Dockerfile.build.agent.coverage +++ b/build/images/Dockerfile.build.agent.coverage @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG GO_VERSION -ARG BUILD_TAG +# GO_VERSION and BUILD_TAG are expected to be overridden by CI build scripts +ARG GO_VERSION=1.23 +ARG BUILD_TAG=latest FROM golang:${GO_VERSION} AS antrea-build WORKDIR /antrea diff --git a/build/images/Dockerfile.build.agent.ubi b/build/images/Dockerfile.build.agent.ubi index 85360c94e43..f94cf3f5078 100644 --- a/build/images/Dockerfile.build.agent.ubi +++ b/build/images/Dockerfile.build.agent.ubi @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG GO_VERSION -ARG BUILD_TAG +# GO_VERSION and BUILD_TAG are expected to be overridden by CI build scripts +ARG GO_VERSION=1.23 +ARG BUILD_TAG=latest FROM golang:${GO_VERSION} AS antrea-build WORKDIR /antrea diff --git a/build/images/Dockerfile.build.agent.ubuntu b/build/images/Dockerfile.build.agent.ubuntu index bebe826f818..968246f34b6 100644 --- a/build/images/Dockerfile.build.agent.ubuntu +++ b/build/images/Dockerfile.build.agent.ubuntu @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG GO_VERSION -ARG BUILD_TAG +# GO_VERSION and BUILD_TAG are expected to be overridden by CI build scripts +ARG GO_VERSION=1.23 +ARG BUILD_TAG=latest FROM golang:${GO_VERSION} AS antrea-build WORKDIR /antrea diff --git a/build/images/Dockerfile.build.controller.coverage b/build/images/Dockerfile.build.controller.coverage index 9980548ac81..7309453da20 100644 --- a/build/images/Dockerfile.build.controller.coverage +++ b/build/images/Dockerfile.build.controller.coverage @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG GO_VERSION -ARG BUILD_TAG +# GO_VERSION is expected to be overridden by CI build scripts +ARG GO_VERSION=1.23 FROM golang:${GO_VERSION} AS antrea-build WORKDIR /antrea diff --git a/build/images/Dockerfile.build.controller.ubi b/build/images/Dockerfile.build.controller.ubi index 73694bbc570..99b092065a0 100644 --- a/build/images/Dockerfile.build.controller.ubi +++ b/build/images/Dockerfile.build.controller.ubi @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG GO_VERSION -ARG BUILD_TAG +# GO_VERSION is expected to be overridden by CI build scripts +ARG GO_VERSION=1.23 FROM golang:${GO_VERSION} AS antrea-build WORKDIR /antrea diff --git a/build/images/Dockerfile.build.controller.ubuntu b/build/images/Dockerfile.build.controller.ubuntu index 92be5b0bdf7..2a95e2e6662 100644 --- a/build/images/Dockerfile.build.controller.ubuntu +++ b/build/images/Dockerfile.build.controller.ubuntu @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG GO_VERSION -ARG BUILD_TAG +# GO_VERSION is expected to be overridden by CI build scripts +ARG GO_VERSION=1.23 FROM golang:${GO_VERSION} AS antrea-build WORKDIR /antrea diff --git a/build/images/Dockerfile.build.migrator b/build/images/Dockerfile.build.migrator index 75024e4d1f2..d0c76d7c1e7 100644 --- a/build/images/Dockerfile.build.migrator +++ b/build/images/Dockerfile.build.migrator @@ -21,7 +21,7 @@ USER root COPY build/images/scripts/migrate_cni /usr/local/bin/ -ENV CRICTL_VERSION="v1.27.0" +ENV CRICTL_VERSION="v1.31.1" RUN apt update \ && apt install -y jq ca-certificates wget \ && rm -rf /var/cache/apt/* /var/lib/apt/lists/* \ diff --git a/build/images/Dockerfile.build.windows b/build/images/Dockerfile.build.windows index 252b873c0f3..3d9a5a2764f 100644 --- a/build/images/Dockerfile.build.windows +++ b/build/images/Dockerfile.build.windows @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG GO_VERSION -ARG OVS_VERSION +# GO_VERSION and OVS_VERSION are expected to be overridden by CI build scripts +ARG GO_VERSION=1.23 +ARG OVS_VERSION=3.0.5 FROM --platform=linux/amd64 golang:${GO_VERSION} AS antrea-build-windows ARG CNI_BINARIES_VERSION diff --git a/build/images/Dockerfile.simulator.build.ubuntu b/build/images/Dockerfile.simulator.build.ubuntu index b9192c7f0a2..d48e9092462 100644 --- a/build/images/Dockerfile.simulator.build.ubuntu +++ b/build/images/Dockerfile.simulator.build.ubuntu @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG GO_VERSION +# GO_VERSION is expected to be overridden by CI build scripts +ARG GO_VERSION=1.23 FROM golang:${GO_VERSION} AS antrea-build WORKDIR /antrea diff --git a/build/images/base/Dockerfile b/build/images/base/Dockerfile index 8221325e9a2..7bb533ddc84 100644 --- a/build/images/base/Dockerfile +++ b/build/images/base/Dockerfile @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG BUILD_TAG +# BUILD_TAG is expected to be overridden by CI build scripts +ARG BUILD_TAG=latest FROM ubuntu:24.04 AS cni-binaries ARG CNI_BINARIES_VERSION diff --git a/build/images/base/Dockerfile.ubi b/build/images/base/Dockerfile.ubi index c6134bc911c..43ab31e8718 100644 --- a/build/images/base/Dockerfile.ubi +++ b/build/images/base/Dockerfile.ubi @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG BUILD_TAG +# BUILD_TAG is expected to be overridden by CI build scripts +ARG BUILD_TAG=latest FROM ubuntu:24.04 AS cni-binaries ARG CNI_BINARIES_VERSION diff --git a/build/images/codegen/Dockerfile b/build/images/codegen/Dockerfile index ad70a545df8..a74c0fa5270 100644 --- a/build/images/codegen/Dockerfile +++ b/build/images/codegen/Dockerfile @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG GO_VERSION +# GO_VERSION is expected to be overridden by CI build scripts +ARG GO_VERSION=1.23 FROM ubuntu:24.04 AS protoc RUN apt-get update && \ diff --git a/build/images/flow-aggregator/Dockerfile b/build/images/flow-aggregator/Dockerfile index e844b93dc6c..ddbf03dcaa6 100644 --- a/build/images/flow-aggregator/Dockerfile +++ b/build/images/flow-aggregator/Dockerfile @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG GO_VERSION +# GO_VERSION is expected to be overridden by CI build scripts +ARG GO_VERSION=1.23 FROM golang:${GO_VERSION} AS flow-aggregator-build WORKDIR /antrea diff --git a/build/images/flow-aggregator/Dockerfile.coverage b/build/images/flow-aggregator/Dockerfile.coverage index 61c1cf9645d..8d14335623d 100644 --- a/build/images/flow-aggregator/Dockerfile.coverage +++ b/build/images/flow-aggregator/Dockerfile.coverage @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG GO_VERSION +# GO_VERSION is expected to be overridden by CI build scripts +ARG GO_VERSION=1.23 FROM golang:${GO_VERSION} AS flow-aggregator-build WORKDIR /antrea diff --git a/build/images/ovs/Dockerfile b/build/images/ovs/Dockerfile index 626dfbb5173..8df23469878 100644 --- a/build/images/ovs/Dockerfile +++ b/build/images/ovs/Dockerfile @@ -16,7 +16,8 @@ FROM ubuntu:24.04 AS ovs-debs # Some patches may not apply cleanly if a non-default version is provided. # See build/images/deps/ovs-version for the default version. -ARG OVS_VERSION +# OVS_VERSION is expected to be overridden by CI build scripts. +ARG OVS_VERSION=2.17.7 # Install dependencies for building OVS deb packages # We only install python3 packages and we only support building OVS >= 2.13.0. diff --git a/build/images/ovs/Dockerfile.ubi b/build/images/ovs/Dockerfile.ubi index 9939c0d9494..9d52e429a38 100644 --- a/build/images/ovs/Dockerfile.ubi +++ b/build/images/ovs/Dockerfile.ubi @@ -15,7 +15,8 @@ FROM quay.io/centos/centos:stream9 AS ovs-rpms # Some patches may not apply cleanly if a non-default version is provided. # See build/images/deps/ovs-version for the default version. -ARG OVS_VERSION +# OVS_VERSION is expected to be overridden by CI build scripts. +ARG OVS_VERSION=2.17.7 # Install RPM tools and generic build dependencies. RUN yum clean all -y && yum -y install wget git yum-utils python3 rpm-build && \ @@ -40,7 +41,8 @@ RUN cd /tmp/openvswitch* && \ rm -rf /tmp/openvswitch* FROM registry.access.redhat.com/ubi9 -ARG OVS_VERSION +# OVS_VERSION is expected to be overridden by CI build scripts. +ARG OVS_VERSION=2.17.7 LABEL maintainer="Antrea " LABEL description="A Docker image based on UBI9 which includes Open vSwitch built from source." diff --git a/build/images/ovs/Dockerfile.windows b/build/images/ovs/Dockerfile.windows index ff14537c4aa..05e77e4e3e3 100644 --- a/build/images/ovs/Dockerfile.windows +++ b/build/images/ovs/Dockerfile.windows @@ -13,7 +13,8 @@ # limitations under the License. FROM --platform=linux/amd64 ubuntu:24.04 AS antrea-windows-builder -ARG OVS_VERSION +# OVS_VERSION is expected to be overridden by CI build scripts +ARG OVS_VERSION=3.0.5 RUN apt-get update && \ DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends unzip diff --git a/build/images/test/Dockerfile b/build/images/test/Dockerfile index 4b4ae0899a0..d75b56a5ef8 100644 --- a/build/images/test/Dockerfile +++ b/build/images/test/Dockerfile @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG BUILD_TAG +# BUILD_TAG is expected to be overridden by CI build scripts +ARG BUILD_TAG=latest FROM antrea/openvswitch:${BUILD_TAG} LABEL maintainer="Antrea " @@ -22,7 +23,8 @@ RUN apt-get update && \ apt-get install -y --no-install-recommends iproute2 iptables ipset jq make wget gcc libc6-dev ca-certificates git && \ rm -rf /var/cache/apt/* /var/lib/apt/lists/* -ARG GO_VERSION +# GO_VERSION is expected to be overridden by CI build scripts +ARG GO_VERSION=1.23 ENV GOPATH /go RUN GO_ARCHIVE=$(wget -q -O - "https://go.dev/dl/?mode=json&include=all" | jq --arg version_prefix "go${GO_VERSION}." -r '. | map(select(. | .version | startswith($version_prefix))) | first | .files[] | select(.os == "linux" and .arch == "amd64" and .kind == "archive").filename') && \ diff --git a/multicluster/build/images/Dockerfile.build b/multicluster/build/images/Dockerfile.build index c1244d87e54..a71dcb5c1df 100644 --- a/multicluster/build/images/Dockerfile.build +++ b/multicluster/build/images/Dockerfile.build @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG GO_VERSION +# GO_VERSION is expected to be overridden by CI build scripts +ARG GO_VERSION=1.23 FROM golang:${GO_VERSION} AS antrea-build WORKDIR /antrea diff --git a/multicluster/build/images/Dockerfile.build.coverage b/multicluster/build/images/Dockerfile.build.coverage index 85112643867..e6c15735be4 100644 --- a/multicluster/build/images/Dockerfile.build.coverage +++ b/multicluster/build/images/Dockerfile.build.coverage @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG GO_VERSION +# GO_VERSION is expected to be overridden by CI build scripts +ARG GO_VERSION=1.23 FROM golang:${GO_VERSION} AS antrea-build WORKDIR /antrea