@@ -32,7 +32,10 @@ PULL_POLICY ?= Always
3232
3333#  Define Docker related variables. Releases should modify and double check these vars.
3434REGISTRY  ?= 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 ) 
3639TAG  ?= dev
3740ARCH  ?= amd64
3841ALL_ARCH  = amd64 arm arm64 ppc64le s390x
@@ -149,6 +152,7 @@ docker-push-manifest: ## Push the fat manifest docker image.
149152	# # Minimum docker version 18.06.0 is required for creating and pushing manifest images.
150153	docker manifest create --amend $(CONTROLLER_IMG ) :$(TAG )  $(shell  echo $(ALL_ARCH )  | sed -e "s~[^ ]* ~$(CONTROLLER_IMG ) \-&:$(TAG ) ~g") 
151154	@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} 
152156	MANIFEST_IMG=$(CONTROLLER_IMG )  MANIFEST_TAG=$(TAG )  $(MAKE )  set-manifest-image
153157
154158.PHONY : set-manifest-image
@@ -166,16 +170,16 @@ RELEASE_TAG := $(shell git describe --abbrev=0 2>/dev/null)
166170release :  # # Builds and push container images using the latest git tag for the commit.
167171	@if [ -z  " ${RELEASE_TAG} " ;  then  echo  " RELEASE_TAG is not set" ;  exit  1;  fi 
168172	#  Push the release image to the staging bucket first.
169- 	REGISTRY=gcr.io/k8s-staging-capi-kubeadm  TAG=$(RELEASE_TAG )  \ 
173+ 	REGISTRY=$( STAGING_REGISTRY ) $(RELEASE_TAG )  \ 
170174		$(MAKE )  docker-build-all docker-push-all
171175	#  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
174178	#  Generate release artifacts.
175179	mkdir -p out/
176180	kustomize build config/default >  out/bootstrap-components.yaml
177181
178182.PHONY : release-staging-latest
179183release-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 ) \ 
181185		$(MAKE )  docker-build-all docker-push-all
0 commit comments