Skip to content

Commit 7520b6b

Browse files
committed
Fix bug where REGISTRY is not set when gcloud isn't present
1 parent 0f48c52 commit 7520b6b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,15 @@ SETUP_ENVTEST_PKG := sigs.k8s.io/controller-runtime/tools/setup-envtest
147147
KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST) use --use-env -p path $(KUBEBUILDER_ENVTEST_KUBERNETES_VERSION))
148148

149149
# Define Docker related variables. Releases should modify and double check these vars.
150-
ifeq (,$(shell command -v gcloud))
151-
REGISTRY ?= gcr.io/$(shell gcloud config get-value project)
152-
else
153-
REGISTRY ?= localhost:5000
150+
ifneq (,$(shell command -v gcloud))
151+
ifneq (,$(shell gcloud config get-value project))
152+
REGISTRY ?= gcr.io/$(shell gcloud config get-value project)
153+
endif
154+
endif
155+
156+
# If REGISTRY is not set, default to localhost:5000 to use the kind registry.
157+
ifndef REGISTRY
158+
REGISTRY ?= localhost:5000
154159
endif
155160
STAGING_REGISTRY := gcr.io/k8s-staging-cluster-api-azure
156161
PROD_REGISTRY := registry.k8s.io/cluster-api-azure

0 commit comments

Comments
 (0)