Skip to content

Commit 2c160be

Browse files
anik120tmshort
authored andcommitted
(makefile) Dynamically set GOARCH flag while building binaries (#2871)
The GOARCH flag was hardcoded to "386", which causes the binaries to not work properly on machines with arm64 arch. This PR dynamically sets the GOARCH flag to arm64 if the machine arch is arm64, or to 386 for all other arch. Signed-off-by: anik120 <[email protected]> Signed-off-by: anik120 <[email protected]> Upstream-repository: operator-lifecycle-manager Upstream-commit: a8edd5c05a1dbeba19b80110b2d4df50ffb96c4c
1 parent 0b705c2 commit 2c160be

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

pkg/manifests/csv.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
name: packageserver
66
namespace: openshift-operator-lifecycle-manager
77
labels:
8-
olm.version: 0.0.0-5e4c07934c95c017f555df621cf66cf7ff60428b
8+
olm.version: 0.0.0-fd79d2301b18b009d8e49ca973d166916302908f
99
olm.clusteroperator.name: operator-lifecycle-manager-packageserver
1010
annotations:
1111
include.release.openshift.io/self-managed-high-availability: "true"
@@ -159,7 +159,7 @@ spec:
159159
- packageserver
160160
topologyKey: "kubernetes.io/hostname"
161161
maturity: alpha
162-
version: 0.0.0-5e4c07934c95c017f555df621cf66cf7ff60428b
162+
version: 0.0.0-fd79d2301b18b009d8e49ca973d166916302908f
163163
apiservicedefinitions:
164164
owned:
165165
- group: packages.operators.coreos.com

staging/operator-lifecycle-manager/Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ GO := GO111MODULE=on GOFLAGS="$(MOD_FLAGS)" go
2929
GINKGO := $(GO) run github.com/onsi/ginkgo/v2/ginkgo
3030
BINDATA := $(GO) run github.com/go-bindata/go-bindata/v3/go-bindata
3131
GIT_COMMIT := $(shell git rev-parse HEAD)
32-
32+
ifeq ($(shell arch), arm64)
33+
ARCH := arm64
34+
else
35+
ARCH := 386
36+
endif
3337
# Phony prerequisite for targets that rely on the go build cache to determine staleness.
3438
.PHONY: build test clean vendor \
3539
coverage coverage-html e2e \
@@ -82,15 +86,15 @@ build-coverage: build_cmd=test -c -covermode=count -coverpkg ./pkg/controller/..
8286
build-coverage: clean $(CMDS)
8387

8488
build-linux: build_cmd=build
85-
build-linux: arch_flags=GOOS=linux GOARCH=386
89+
build-linux: arch_flags=GOOS=linux GOARCH=$(ARCH)
8690
build-linux: clean $(CMDS)
8791

8892
build-wait: clean bin/wait
8993

9094
bin/wait: FORCE
91-
GOOS=linux GOARCH=386 go build $(MOD_FLAGS) -o $@ $(PKG)/test/e2e/wait
95+
GOOS=linux GOARCH=$(ARCH) go build $(MOD_FLAGS) -o $@ $(PKG)/test/e2e/wait
9296

93-
build-util-linux: arch_flags=GOOS=linux GOARCH=386
97+
build-util-linux: arch_flags=GOOS=linux GOARCH=$(ARCH)
9498
build-util-linux: build-util
9599

96100
build-util: bin/cpb

0 commit comments

Comments
 (0)