From f92fdee6f23dfebfffbbcc335075eee7746da7c9 Mon Sep 17 00:00:00 2001 From: Philip Laine Date: Wed, 13 May 2026 14:02:51 +0200 Subject: [PATCH] Fix incorrect arch build for ARM64 in multiarch images (#252) GOARCH was used instead of the input variable when building mulitarch images. Fixes #237 Signed-off-by: Philip Laine --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 1f82a4d..f05a05f 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,6 @@ SHELL = /usr/bin/env bash -o pipefail .SHELLFLAGS = -ec -GOARCH = $(shell go env GOARCH) ifeq (,$(shell go env GOBIN)) GOBIN = $(shell go env GOPATH)/bin else @@ -49,10 +48,10 @@ test-e2e: build-image cd ./test/e2e && IMG_REF=${IMG_REF} go test ./... -v -count 1 .PHONY: build -build: generate bin/linux-$(GOARCH)/netbird-operator +build: generate bin/linux-$(shell go env GOARCH)/netbird-operator bin/linux-%/netbird-operator: $(shell find api cmd internal pkg) go.mod go.sum - @CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) go build -ldflags="-w -s" -trimpath -o $@ cmd/main.go + @CGO_ENABLED=0 GOOS=linux GOARCH=$* go build -ldflags="-w -s" -trimpath -o $@ cmd/main.go .PHONY: build-image build-image: build