@@ -32,7 +32,10 @@ PULL_POLICY ?= Always
32
32
33
33
# Define Docker related variables. Releases should modify and double check these vars.
34
34
REGISTRY ?= gcr.io/$(shell gcloud config get-value project)
35
- CONTROLLER_IMG ?= $(REGISTRY ) /cluster-api-kubeadm-controller
35
+ STAGING_REGISTRY := gcr.io/k8s-staging-capi-kubeadm
36
+ PROD_REGISTRY := us.gcr.io/k8s-artifacts-prod/capi-kubeadm
37
+ IMAGE_NAME ?= cluster-api-kubeadm-controller
38
+ CONTROLLER_IMG ?= $(REGISTRY ) /$(IMAGE_NAME )
36
39
TAG ?= dev
37
40
ARCH ?= amd64
38
41
ALL_ARCH = amd64 arm arm64 ppc64le s390x
@@ -149,6 +152,7 @@ docker-push-manifest: ## Push the fat manifest docker image.
149
152
# # Minimum docker version 18.06.0 is required for creating and pushing manifest images.
150
153
docker manifest create --amend $(CONTROLLER_IMG ) :$(TAG ) $(shell echo $(ALL_ARCH ) | sed -e "s~[^ ]* ~$(CONTROLLER_IMG ) \-&:$(TAG ) ~g")
151
154
@for arch in $(ALL_ARCH ) ; do docker manifest annotate --arch $$ {arch} ${CONTROLLER_IMG} :${TAG} ${CONTROLLER_IMG} -$$ {arch}:${TAG} ; done
155
+ docker manifest push --purge ${CONTROLLER_IMG} :${TAG}
152
156
MANIFEST_IMG=$(CONTROLLER_IMG ) MANIFEST_TAG=$(TAG ) $(MAKE ) set-manifest-image
153
157
154
158
.PHONY : set-manifest-image
@@ -166,16 +170,16 @@ RELEASE_TAG := $(shell git describe --abbrev=0 2>/dev/null)
166
170
release : # # Builds and push container images using the latest git tag for the commit.
167
171
@if [ -z " ${RELEASE_TAG} " ]; then echo " RELEASE_TAG is not set" ; exit 1; fi
168
172
# Push the release image to the staging bucket first.
169
- REGISTRY=gcr.io/k8s-staging-capi-kubeadm TAG=$(RELEASE_TAG ) \
173
+ REGISTRY=$( STAGING_REGISTRY ) TAG=$(RELEASE_TAG ) \
170
174
$(MAKE ) docker-build-all docker-push-all
171
175
# Set the manifest image to the production bucket.
172
- REGISTRY=us.gcr.io/k8s-artifacts-prod/capi-kubeadm TAG =$(RELEASE_TAG ) \
173
- set-manifest-image
176
+ MANIFEST_IMG= $( PROD_REGISTRY ) / $( IMAGE_NAME ) MANIFEST_TAG =$(RELEASE_TAG ) \
177
+ $( MAKE ) set-manifest-image
174
178
# Generate release artifacts.
175
179
mkdir -p out/
176
180
kustomize build config/default > out/bootstrap-components.yaml
177
181
178
182
.PHONY : release-staging-latest
179
183
release-staging-latest : # # Builds and push container images to the staging bucket using "latest" tag.
180
- REGISTRY=gcr.io/k8s-staging-capi-kubeadm TAG=latest \
184
+ REGISTRY=$( STAGING_REGISTRY ) TAG=latest \
181
185
$(MAKE ) docker-build-all docker-push-all
0 commit comments