From 4428e6e75e0bf841250dcec8f837c037c692d2cb Mon Sep 17 00:00:00 2001 From: Elvin Efendi Date: Wed, 18 Mar 2020 20:00:37 -0400 Subject: [PATCH] do not require go for building --- Makefile | 9 +++++---- build/run-in-docker.sh | 5 ++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 2fd29ccd7..9ca95789f 100644 --- a/Makefile +++ b/Makefile @@ -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: @@ -274,7 +270,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: diff --git a/build/run-in-docker.sh b/build/run-in-docker.sh index a3676e5b1..07cd16e20 100755 --- a/build/run-in-docker.sh +++ b/build/run-in-docker.sh @@ -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}"