Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .ci/build-push-controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,21 @@ GO_VERSION=${GO_VERSION:-1.22.5}

IMAGE_REGISTRY=${IMAGE_REGISTRY:-"quay.io/platform9/cluster-api-provider-bringyourownhost"}
IMAGE_NAME=${IMAGE_NAME:-"controller-manager"}
IMAGE_TAG=${IMAGE_TAG:-$(make -C "${project_root}" tag)}
IMAGE_TAG=${IMAGE_TAG:-$(make --no-print-directory -C "${project_root}" tag)}
IMAGE_NAME_TAG=${IMAGE_NAME}:${IMAGE_TAG}
IMAGE_REGISTRY_NAME_TAG=${IMAGE_REGISTRY}/${IMAGE_NAME_TAG}

# make -C implicitly enables --print-directory on some GNU Make versions
# (confirmed: not on this repo's dev-Mac Make 3.81, but yes on the Ubuntu
# CI runner's newer Make) -- without --no-print-directory above, the
# "Entering directory" chatter leaks into IMAGE_TAG via command
# substitution and corrupts the docker -t argument. Fail loud if it ever
# recurs instead of silently building/pushing a mistagged image.
if [[ "${IMAGE_TAG}" =~ [[:space:]] ]]; then
echo "ERROR: IMAGE_TAG contains whitespace, likely make output leaked into the tag: '${IMAGE_TAG}'" >&2
exit 1
fi


main() {
# Move to the project directory
Expand Down
2 changes: 1 addition & 1 deletion cmd/byohctl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SHELL := /usr/bin/env bash
# hardcoding or independently recomputing anything.
# Override for one-off local testing: `make build VERSION=v9.9.9-test`.
REPO_ROOT := $(shell git rev-parse --show-toplevel)
VERSION ?= $(shell $(MAKE) -C $(REPO_ROOT) tag)
VERSION ?= $(shell $(MAKE) --no-print-directory -C $(REPO_ROOT) tag)

# Build settings
BINARY_NAME := byohctl
Expand Down
Loading