Skip to content

Commit 7746f28

Browse files
committed
Build test and production images consistently
1 parent 91c9183 commit 7746f28

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ ALL_ARCH ?= amd64 arm arm64 ppc64le s390x
8383
# main controller
8484
IMAGE_NAME ?= capi-openstack-controller
8585
CONTROLLER_IMG ?= $(REGISTRY)/$(IMAGE_NAME)
86+
CONTROLLER_IMG_TAG ?= $(CONTROLLER_IMG)-$(ARCH):$(TAG)
8687
CONTROLLER_ORIGINAL_IMG := gcr.io/k8s-staging-capi-openstack/capi-openstack-controller
8788
CONTROLLER_NAME := capo-controller-manager
8889
MANIFEST_FILE := infrastructure-components
@@ -127,8 +128,8 @@ test-e2e: $(GINKGO) $(KIND) $(KUSTOMIZE) e2e-image test-e2e-image-prerequisites
127128
time $(GINKGO) -trace -progress -v -tags=e2e --nodes=$(E2E_GINKGO_PARALLEL) $(E2E_GINKGO_ARGS) ./test/e2e/suites/e2e/... -- -config-path="$(E2E_CONF_PATH)" -artifacts-folder="$(ARTIFACTS)" --data-folder="$(E2E_DATA_DIR)" $(E2E_ARGS)
128129

129130
.PHONY: e2e-image
130-
e2e-image: docker-pull-prerequisites
131-
docker build -f $(CONTAINERFILE) --tag="gcr.io/k8s-staging-capi-openstack/capi-openstack-controller:e2e" .
131+
e2e-image: CONTROLLER_IMG_TAG = "gcr.io/k8s-staging-capi-openstack/capi-openstack-controller:e2e"
132+
e2e-image: docker-build
132133

133134
# Pull all the images references in test/e2e/data/e2e_conf.yaml
134135
test-e2e-image-prerequisites:
@@ -226,11 +227,11 @@ generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
226227

227228
.PHONY: docker-build
228229
docker-build: docker-pull-prerequisites ## Build the docker image for controller-manager
229-
docker build -f $(CONTAINERFILE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg LDFLAGS="$(LDFLAGS)" . -t $(CONTROLLER_IMG)-$(ARCH):$(TAG)
230+
docker build -f $(CONTAINERFILE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg LDFLAGS="$(LDFLAGS)" . -t $(CONTROLLER_IMG_TAG)
230231

231232
.PHONY: docker-push
232233
docker-push: ## Push the docker image
233-
docker push $(CONTROLLER_IMG)-$(ARCH):$(TAG)
234+
docker push $(CONTROLLER_IMG_TAG)
234235

235236
.PHONY: docker-pull-prerequisites
236237
docker-pull-prerequisites:

0 commit comments

Comments
 (0)