From 9d922aa2ae9a82a71e39fbd5212bea6686073b23 Mon Sep 17 00:00:00 2001 From: Dimitri Koshkin Date: Tue, 29 Oct 2024 12:05:15 -0700 Subject: [PATCH] fix: bundle correct arch for the mindthegap binary (#954) **What problem does this PR solve?**: Latest changes broke the published arm build. The `mindthegap` binary from `bundle_builder` will always be `BUILDPLATFORM`, but we want it to match `TARGETPLATFORM`. **Which issue(s) this PR fixes**: Fixes # **How Has This Been Tested?**: **Special notes for your reviewer**: --- hack/addons/mindthegap-helm-registry/Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hack/addons/mindthegap-helm-registry/Dockerfile b/hack/addons/mindthegap-helm-registry/Dockerfile index 74aaa617d..4481e52c5 100644 --- a/hack/addons/mindthegap-helm-registry/Dockerfile +++ b/hack/addons/mindthegap-helm-registry/Dockerfile @@ -3,10 +3,15 @@ FROM --platform=${BUILDPLATFORM} ghcr.io/mesosphere/mindthegap:${MINDTHEGAP_VERS # this gets called by goreleaser so the copy source has to be the path relative to the repo root. RUN --mount=source=./hack/addons/mindthegap-helm-registry/repos.yaml,target=/repos.yaml \ ["/ko-app/mindthegap", "create", "bundle", "--helm-charts-file=/repos.yaml", "--output-file=/tmp/helm-charts.tar"] + +FROM --platform=${TARGETPLATFORM} ghcr.io/mesosphere/mindthegap:${MINDTHEGAP_VERSION} as mindthegap + FROM --platform=${TARGETPLATFORM} alpine:3.20.3 +# Add mindthegap binary that matches TARGETPLATFORM +COPY --from=mindthegap /ko-app/mindthegap /usr/bin/mindthegap +# Add helm charts for the current version ARG VERSION COPY --from=bundle_builder /tmp/helm-charts.tar /charts/helm-charts-${VERSION}.tar -COPY --from=bundle_builder /ko-app/mindthegap /usr/bin/mindthegap # TODO remove me as soon as its not needed to hold multiple versions of helm charts COPY --from=ghcr.io/nutanix-cloud-native/caren-helm-reg:v0.14.6 /tmp/helm-charts.tar /charts/helm-charts-v0.14.6.tar COPY --from=ghcr.io/nutanix-cloud-native/caren-helm-reg:v0.14.9 /tmp/helm-charts.tar /charts/helm-charts-v0.14.9.tar