From ea924e26bac98b1d5ec9a6d872a04589dad6cd0c Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Sun, 10 Sep 2023 14:42:52 +0900 Subject: [PATCH 1/2] chore: To determine the binary format in the Dockerfile, we decided to use TARGETARCH instead of go_arch to facilitate multi-platform build. Signed-off-by: kahirokunn --- Dockerfile | 7 ++++--- Dockerfile.local | 6 +++--- .../config/manifests/bases/clusterserviceversion.yaml.tpl | 4 ++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index f5ef2e196..088dee08a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ # Base image to use at runtime ARG base_image=public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot:2021-12-01-1638322424 +ARG TARGETARCH=amd64 + # Golang image to use for compiling the manager ARG builder_image=public.ecr.aws/docker/library/golang -# Version of Golang +# Version of Golang ARG golang_version # Build the manager binary @@ -15,14 +17,13 @@ ARG service_alias ARG service_controller_git_version ARG service_controller_git_commit ARG build_date -ARG go_arch=amd64 # The directory within the builder container into which we will copy our # service controller code. ARG work_dir=/github.com/aws-controllers-k8s/$service_alias-controller WORKDIR $work_dir ENV GOPROXY=https://proxy.golang.org|direct ENV GO111MODULE=on -ENV GOARCH=$go_arch +ENV GOARCH=$TARGETARCH ENV GOOS=linux ENV CGO_ENABLED=0 ENV VERSION_PKG=github.com/aws-controllers-k8s/$service_alias-controller/pkg/version diff --git a/Dockerfile.local b/Dockerfile.local index b813fb256..3a2953671 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -4,7 +4,7 @@ ARG base_image=public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-n # Golang image to use for compiling the manager ARG builder_image=public.ecr.aws/docker/library/golang -# Version of Golang +# Version of Golang ARG golang_version # Build the manager binary @@ -15,14 +15,14 @@ ARG service_alias ARG service_controller_git_version ARG service_controller_git_commit ARG build_date -ARG go_arch=amd64 +ARG TARGETARCH=amd64 # The directory within the builder container into which we will copy our # service controller code. ARG work_dir=/github.com/aws-controllers-k8s/$service_alias-controller WORKDIR $work_dir ENV GOPROXY=https://proxy.golang.org|direct ENV GO111MODULE=on -ENV GOARCH=$go_arch +ENV GOARCH=$TARGETARCH ENV GOOS=linux ENV CGO_ENABLED=0 ENV VERSION_PKG=github.com/aws-controllers-k8s/$service_alias-controller/pkg/version diff --git a/templates/config/manifests/bases/clusterserviceversion.yaml.tpl b/templates/config/manifests/bases/clusterserviceversion.yaml.tpl index 28c0fb112..af629ee57 100644 --- a/templates/config/manifests/bases/clusterserviceversion.yaml.tpl +++ b/templates/config/manifests/bases/clusterserviceversion.yaml.tpl @@ -12,6 +12,10 @@ metadata: createdAt: {{.CreatedAt}} support: {{.Annotations.Support}} certified: {{.Annotations.IsCertified}} + labels: + operatorframework.io/os.linux: supported + operatorframework.io/arch.amd64: supported + operatorframework.io/arch.arm64: supported name: ack-{{.ServicePackageName }}-controller.v0.0.0 namespace: placeholder spec: From 7822dc1ba8401b1d7358c433912489624be5cbed Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Tue, 14 Nov 2023 11:34:27 +0900 Subject: [PATCH 2/2] TARGETARCH was changed to SNAKE CASE Signed-off-by: kahirokunn --- Dockerfile | 4 ++-- Dockerfile.local | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 088dee08a..d7a00dd84 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # Base image to use at runtime ARG base_image=public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot:2021-12-01-1638322424 -ARG TARGETARCH=amd64 +ARG target_arch=amd64 # Golang image to use for compiling the manager ARG builder_image=public.ecr.aws/docker/library/golang @@ -23,7 +23,7 @@ ARG work_dir=/github.com/aws-controllers-k8s/$service_alias-controller WORKDIR $work_dir ENV GOPROXY=https://proxy.golang.org|direct ENV GO111MODULE=on -ENV GOARCH=$TARGETARCH +ENV GOARCH=$target_arch ENV GOOS=linux ENV CGO_ENABLED=0 ENV VERSION_PKG=github.com/aws-controllers-k8s/$service_alias-controller/pkg/version diff --git a/Dockerfile.local b/Dockerfile.local index 3a2953671..2d37dee83 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -15,14 +15,14 @@ ARG service_alias ARG service_controller_git_version ARG service_controller_git_commit ARG build_date -ARG TARGETARCH=amd64 +ARG target_arch=amd64 # The directory within the builder container into which we will copy our # service controller code. ARG work_dir=/github.com/aws-controllers-k8s/$service_alias-controller WORKDIR $work_dir ENV GOPROXY=https://proxy.golang.org|direct ENV GO111MODULE=on -ENV GOARCH=$TARGETARCH +ENV GOARCH=$target_arch ENV GOOS=linux ENV CGO_ENABLED=0 ENV VERSION_PKG=github.com/aws-controllers-k8s/$service_alias-controller/pkg/version