Skip to content

Commit 8ea6f2a

Browse files
authored
Add strip to all Makefile variables (#4112)
Removes whitespaces from all variables to avoid issues.
1 parent b3491af commit 8ea6f2a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ override DOCKER_BUILD_OPTIONS += --build-arg IC_VERSION=$(VERSION) ## The option
1111
ARCH ?= amd64 ## The architecture of the image or binary. For example: amd64, arm64, ppc64le, s390x. Not all architectures are supported for all targets
1212

1313
# final docker build command
14-
DOCKER_CMD = docker build --platform linux/$(ARCH) $(strip $(DOCKER_BUILD_OPTIONS)) --target $(strip $(TARGET)) -f build/Dockerfile -t $(strip $(PREFIX)):$(strip $(TAG)) .
14+
DOCKER_CMD = docker build --platform linux/$(strip $(ARCH)) $(strip $(DOCKER_BUILD_OPTIONS)) --target $(strip $(TARGET)) -f build/Dockerfile -t $(strip $(PREFIX)):$(strip $(TAG)) .
1515

1616
export DOCKER_BUILDKIT = 1
1717

@@ -75,7 +75,7 @@ build: ## Build Ingress Controller binary
7575
@docker -v || (code=$$?; printf "\033[0;31mError\033[0m: there was a problem with Docker\n"; exit $$code)
7676
ifeq ($(strip $(TARGET)),local)
7777
@go version || (code=$$?; printf "\033[0;31mError\033[0m: unable to build locally, try using the parameter TARGET=container or TARGET=download\n"; exit $$code)
78-
CGO_ENABLED=0 GOOS=linux GOARCH=$(ARCH) go build -trimpath -ldflags "-s -w -X main.version=${VERSION}" -o nginx-ingress github.com/nginxinc/kubernetes-ingress/cmd/nginx-ingress
78+
CGO_ENABLED=0 GOOS=linux GOARCH=$(strip $(ARCH)) go build -trimpath -ldflags "-s -w -X main.version=${VERSION}" -o nginx-ingress github.com/nginxinc/kubernetes-ingress/cmd/nginx-ingress
7979
else ifeq ($(strip $(TARGET)),download)
8080
@$(MAKE) download-binary-docker
8181
endif
@@ -93,7 +93,7 @@ endif
9393
.PHONY: build-goreleaser
9494
build-goreleaser: ## Build Ingress Controller binary using GoReleaser
9595
@goreleaser -v || (code=$$?; printf "\033[0;31mError\033[0m: there was a problem with GoReleaser. Follow the docs to install it https://goreleaser.com/install\n"; exit $$code)
96-
GOOS=linux GOPATH=$(shell go env GOPATH) GOARCH=$(ARCH) goreleaser build --clean --debug --snapshot --id kubernetes-ingress --single-target
96+
GOOS=linux GOPATH=$(shell go env GOPATH) GOARCH=$(strip $(ARCH)) goreleaser build --clean --debug --snapshot --id kubernetes-ingress --single-target
9797

9898
.PHONY: debian-image
9999
debian-image: build ## Create Docker image for Ingress Controller (Debian)
@@ -152,7 +152,7 @@ all-images: alpine-image alpine-image-plus debian-image debian-image-plus debian
152152

153153
.PHONY: push
154154
push: ## Docker push to PREFIX and TAG
155-
docker push $(PREFIX):$(TAG)
155+
docker push $(strip $(PREFIX)):$(strip $(TAG))
156156

157157
.PHONY: clean
158158
clean: ## Remove nginx-ingress binary

0 commit comments

Comments
 (0)