From 0dd62eb56fa1eeca36fa51d1c2d2782efa2ddd59 Mon Sep 17 00:00:00 2001 From: travisn Date: Sat, 27 Apr 2019 23:03:03 -0600 Subject: [PATCH] build: do not add generic release docker tag To support upgrades, the operator relies on a changing tag between versions so that when a pod spec is updated, k8s will restart the pod due to the new image name. If the image name does not change, the operator cannot control the upgrade deployment. Therefore, we do not support a generic docker tag such as rook/ceph:release and we expect specific version tags to be specified in the operator such as rook/ceph:v1.0.0. The master build is tagged with a generic tag for convenience of testing the latest builds, but it is important to note that upgrades are not supported between master builds. Signed-off-by: travisn --- build/release/Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/build/release/Makefile b/build/release/Makefile index 6a5b8ca62..a52f61ac3 100644 --- a/build/release/Makefile +++ b/build/release/Makefile @@ -160,16 +160,14 @@ build.image.$(1).$(2).$(3): build.all.images: build.image.$(1).$(2).$(3) publish.image.$(1).$(2).$(3): ; @docker push $(1)/$(2)-$(3):$(VERSION) publish.all.images: publish.image.$(1).$(2).$(3) +# tag the master image, but do not tag the release image with a generic channel tag promote.image.$(1).$(2).$(3): @docker pull $(1)/$(2)-$(3):$(VERSION) - @[ "$(CHANNEL)" = "master" ] || docker tag $(1)/$(2)-$(3):$(VERSION) $(1)/$(2)-$(3):$(VERSION)-$(CHANNEL) @docker tag $(1)/$(2)-$(3):$(VERSION) $(1)/$(2)-$(3):$(CHANNEL) - @[ "$(CHANNEL)" = "master" ] || docker push $(1)/$(2)-$(3):$(VERSION)-$(CHANNEL) - @docker push $(1)/$(2)-$(3):$(CHANNEL) + @[ "$(CHANNEL)" = "release" ] || docker push $(1)/$(2)-$(3):$(CHANNEL) promote.all.images: promote.image.$(1).$(2).$(3) clean.image.$(1).$(2).$(3): @[ -z "$$$$(docker images -q $(1)/$(2)-$(3):$(VERSION))" ] || docker rmi $(1)/$(2)-$(3):$(VERSION) - @[ -z "$$$$(docker images -q $(1)/$(2)-$(3):$(VERSION)-$(CHANNEL))" ] || docker rmi $(1)/$(2)-$(3):$(VERSION)-$(CHANNEL) @[ -z "$$$$(docker images -q $(1)/$(2)-$(3):$(CHANNEL))" ] || docker rmi $(1)/$(2)-$(3):$(CHANNEL) clean.all.images: clean.image.$(1).$(2).$(3) endef @@ -178,9 +176,9 @@ $(foreach r,$(REGISTRIES), $(foreach i,$(IMAGES), $(foreach a,$(IMAGE_ARCHS),$(e publish.manifest.image.%: publish.all.images $(MANIFEST_TOOL) @$(MANIFEST_TOOL) push from-args --platforms $(IMAGE_PLATFORMS) --template $(DOCKER_REGISTRY)/$*-ARCH:$(VERSION) --target $(DOCKER_REGISTRY)/$*:$(VERSION) +# add the "master" tag to the master image, but do not add the "release" tag for the release channel promote.manifest.image.%: promote.all.images $(MANIFEST_TOOL) - @[ "$(CHANNEL)" = "master" ] || $(MANIFEST_TOOL) push from-args --platforms $(IMAGE_PLATFORMS) --template $(DOCKER_REGISTRY)/$*-ARCH:$(VERSION) --target $(DOCKER_REGISTRY)/$*:$(VERSION)-$(CHANNEL) - @$(MANIFEST_TOOL) push from-args --platforms $(IMAGE_PLATFORMS) --template $(DOCKER_REGISTRY)/$*-ARCH:$(VERSION) --target $(DOCKER_REGISTRY)/$*:$(CHANNEL) + @[ "$(CHANNEL)" = "release" ] || $(MANIFEST_TOOL) push from-args --platforms $(IMAGE_PLATFORMS) --template $(DOCKER_REGISTRY)/$*-ARCH:$(VERSION) --target $(DOCKER_REGISTRY)/$*:$(CHANNEL) build.images: build.all.images publish.images: $(addprefix publish.manifest.image.,$(IMAGES))