Skip to content

Commit

Permalink
Merge pull request #5268 from ElvinEfendi/do-not-require-go
Browse files Browse the repository at this point in the history
do not require go for building
  • Loading branch information
k8s-ci-robot authored Mar 19, 2020
2 parents 7627757 + 3c06b1c commit 906e501
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'

ifeq ($(shell which go >/dev/null 2>&1; echo $$?), 1)
$(error Can't find 'go' in PATH, please fix and retry. See http://golang.org/doc/install for installation instructions.)
endif

.DEFAULT_GOAL:=help

.EXPORT_ALL_VARIABLES:
Expand Down Expand Up @@ -59,7 +55,11 @@ PKG = k8s.io/ingress-nginx

BUSTED_ARGS =-v --pattern=_test

ARCH ?= $(shell go env GOARCH)
HOST_ARCH = $(shell which go >/dev/null 2>&1 && go env GOARCH)
ARCH ?= $(HOST_ARCH)
ifeq ($(ARCH),)
$(error mandatory variable ARCH is empty, either set it when calling the command or make sure 'go env GOARCH' works)
endif

REGISTRY ?= quay.io/kubernetes-ingress-controller

Expand Down Expand Up @@ -274,7 +274,12 @@ run-ingress-controller: ## Run the ingress controller locally using a kubectl pr

.PHONY: check-go-version
check-go-version:
ifeq ($(USE_DOCKER), true)
@build/run-in-docker.sh \
hack/check-go-version.sh
else
@hack/check-go-version.sh
endif

.PHONY: init-docker-buildx
init-docker-buildx:
Expand Down
5 changes: 4 additions & 1 deletion build/run-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ KUBE_ROOT=$(cd $(dirname "${BASH_SOURCE}")/.. && pwd -P)
FLAGS=$@

PKG=k8s.io/ingress-nginx
ARCH=$(go env GOARCH)
ARCH=${ARCH:-}
if [[ -z "$ARCH" ]]; then
ARCH=$(go env GOARCH)
fi

# create output directory as current user to avoid problem with docker.
mkdir -p "${KUBE_ROOT}/bin" "${KUBE_ROOT}/bin/${ARCH}"
Expand Down

0 comments on commit 906e501

Please sign in to comment.