Skip to content

Commit

Permalink
Merge pull request #4375 from towca/jtuznik/makefile-1.20
Browse files Browse the repository at this point in the history
Cluster Autoscaler: backport #3768 to 1.20
  • Loading branch information
k8s-ci-robot authored Oct 1, 2021
2 parents 1fc0623 + ed78aa7 commit 28af136
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions cluster-autoscaler/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
cluster-autoscaler
cluster-autoscaler-amd64
cluster-autoscaler-arm64
cluster_autoscaler
.cover

Expand Down
15 changes: 9 additions & 6 deletions cluster-autoscaler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ ifdef DOCKER_RM
else
RM_FLAG=
endif
IMAGE=$(REGISTRY)/cluster-autoscaler$(PROVIDER)

export DOCKER_CLI_EXPERIMENTAL := enabled

build: build-arch-$(GOARCH)

Expand All @@ -53,24 +56,24 @@ make-image: make-image-arch-$(GOARCH)
make-image-arch-%:
ifdef BASEIMAGE
docker build --pull --build-arg BASEIMAGE=${BASEIMAGE} \
-t ${REGISTRY}/cluster-autoscaler${PROVIDER}:${TAG}-$* \
-t ${IMAGE}-$*:${TAG} \
-f Dockerfile.$* .
else
docker build --pull \
-t ${REGISTRY}/cluster-autoscaler${PROVIDER}:${TAG}-$* \
-t ${IMAGE}-$*:${TAG} \
-f Dockerfile.$* .
endif
@echo "Image ${TAG}${FOR_PROVIDER}-$* completed"

push-image: push-image-arch-$(GOARCH)

push-image-arch-%:
./push_image.sh ${REGISTRY}/cluster-autoscaler${PROVIDER}:${TAG}-$*
./push_image.sh ${IMAGE}-$*:${TAG}

push-manifest:
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create ${REGISTRY}/cluster-autoscaler${PROVIDER}:${TAG} \
$(addprefix $(REGISTRY)/cluster-autoscaler$(PROVIDER):$(TAG)-, $(ALL_ARCH))
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push --purge ${REGISTRY}/cluster-autoscaler${PROVIDER}:${TAG}
docker manifest create ${IMAGE}:${TAG} \
$(addprefix $(REGISTRY)/cluster-autoscaler$(PROVIDER)-, $(addsuffix :$(TAG), $(ALL_ARCH)))
docker manifest push --purge ${IMAGE}:${TAG}

execute-release: $(addprefix make-image-arch-,$(ALL_ARCH)) $(addprefix push-image-arch-,$(ALL_ARCH)) push-manifest
@echo "Release ${TAG}${FOR_PROVIDER} completed"
Expand Down

0 comments on commit 28af136

Please sign in to comment.