File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,10 +26,21 @@ GO_VERSION=${GO_VERSION:-1.22.5}
2626
2727IMAGE_REGISTRY=${IMAGE_REGISTRY:- " quay.io/platform9/cluster-api-provider-bringyourownhost" }
2828IMAGE_NAME=${IMAGE_NAME:- " controller-manager" }
29- IMAGE_TAG=${IMAGE_TAG:- $(make -C " ${project_root} " tag)}
29+ IMAGE_TAG=${IMAGE_TAG:- $(make --no-print-directory - C " ${project_root} " tag)}
3030IMAGE_NAME_TAG=${IMAGE_NAME} :${IMAGE_TAG}
3131IMAGE_REGISTRY_NAME_TAG=${IMAGE_REGISTRY} /${IMAGE_NAME_TAG}
3232
33+ # make -C implicitly enables --print-directory on some GNU Make versions
34+ # (confirmed: not on this repo's dev-Mac Make 3.81, but yes on the Ubuntu
35+ # CI runner's newer Make) -- without --no-print-directory above, the
36+ # "Entering directory" chatter leaks into IMAGE_TAG via command
37+ # substitution and corrupts the docker -t argument. Fail loud if it ever
38+ # recurs instead of silently building/pushing a mistagged image.
39+ if [[ " ${IMAGE_TAG} " =~ [[:space:]] ]]; then
40+ echo " ERROR: IMAGE_TAG contains whitespace, likely make output leaked into the tag: '${IMAGE_TAG} '" >&2
41+ exit 1
42+ fi
43+
3344
3445main () {
3546 # Move to the project directory
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ SHELL := /usr/bin/env bash
1616# hardcoding or independently recomputing anything.
1717# Override for one-off local testing: `make build VERSION=v9.9.9-test`.
1818REPO_ROOT := $(shell git rev-parse --show-toplevel)
19- VERSION ?= $(shell $(MAKE ) -C $(REPO_ROOT ) tag)
19+ VERSION ?= $(shell $(MAKE ) --no-print-directory - C $(REPO_ROOT ) tag)
2020
2121# Build settings
2222BINARY_NAME := byohctl
You can’t perform that action at this time.
0 commit comments