Skip to content

Commit

Permalink
UPSTREAM: <carry>: Fix GOARCH in OpenShift build
Browse files Browse the repository at this point in the history
Do not overwrite GOARCH, it is set by our builders to the right value for
x86_64 or arm or whatever we will support in OCP.

In addition, build just one bin/aws-efs-csi-driver, for the current arch.
Don't build anything else.
  • Loading branch information
jsafrane authored and openshift-cherrypick-robot committed Mar 17, 2023
1 parent b3befc9 commit fc5f7d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.openshift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.19-openshift-4.13 AS builder
WORKDIR /go/src/github.com/kubernetes-sigs/aws-efs-csi-driver
COPY . .
RUN make
RUN make bin/aws-efs-csi-driver

# Use a base image with aws-efs-utils installed
FROM registry.ci.openshift.org/ocp/4.13:aws-efs-utils-base
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ word-hyphen = $(word $2,$(subst -, ,$1))
.PHONY: linux/$(ARCH) bin/aws-efs-csi-driver
linux/$(ARCH): bin/aws-efs-csi-driver
bin/aws-efs-csi-driver: | bin
CGO_ENABLED=0 GOOS=linux GOARCH=$(ARCH) go build -mod=vendor -ldflags ${LDFLAGS} -o bin/aws-efs-csi-driver ./cmd/
# OpenShift: <carry>: do not overwrite GOARCH, use the one provided by the builder.
@echo GOARCH:${GOARCH}
CGO_ENABLED=0 GOOS=linux go build -mod=vendor -ldflags ${LDFLAGS} -o bin/aws-efs-csi-driver ./cmd/

.PHONY: all
all: all-image-docker
Expand Down

0 comments on commit fc5f7d5

Please sign in to comment.