From e9a85272d1b3e50f67ca0330ade6093f6c01f2c4 Mon Sep 17 00:00:00 2001 From: Tyler Gillson Date: Fri, 4 Jul 2025 13:01:21 -0600 Subject: [PATCH 1/3] fix: correctly create & push image manifests Signed-off-by: Tyler Gillson --- .github/workflows/releaseimage.yml | 4 +++- README.md | 1 + fleetconfig-controller/Makefile | 15 ++++++++++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/releaseimage.yml b/.github/workflows/releaseimage.yml index 6e9d63e3..2d17907a 100644 --- a/.github/workflows/releaseimage.yml +++ b/.github/workflows/releaseimage.yml @@ -111,4 +111,6 @@ jobs: - name: push run: | - docker manifest push quay.io/open-cluster-management/${{ matrix.repository }}:${{ needs.env.outputs.RELEASE_VERSION }} + set -e + cd ${{ matrix.repository }} + IMAGE_TAG=${{ needs.env.outputs.RELEASE_VERSION }} make image-manifest-push diff --git a/README.md b/README.md index 3da7b9c5..5abaf6e5 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ All projects must define the following `make` targets: - `image-push`: Push all container images. - `image-manifest`: Create multi-architecture manifests for all images. - `image-manifest-annotate`: Annotate multi-architecture manifests for all images. +- `image-manifest-push`: Push finalized image manifests for all images. #### Dockerfiles diff --git a/fleetconfig-controller/Makefile b/fleetconfig-controller/Makefile index e1cead16..3dc45eb1 100644 --- a/fleetconfig-controller/Makefile +++ b/fleetconfig-controller/Makefile @@ -44,7 +44,7 @@ image-manifest: $(eval VARIANT := $(word 1,$(subst :, ,$(flavour)))) \ $(eval VARIANT_TAG := $(if $(filter base,$(VARIANT)),$(IMAGE_TAG),$(IMAGE_TAG)-$(VARIANT))) \ $(eval IMAGE := $(IMAGE_REGISTRY)/$(IMAGE_REPO):$(VARIANT_TAG)) \ - docker manifest create $(IMAGE) $(IMAGE)-amd64 --amd64 $(IMAGE)-arm64 --arm64; \ + docker manifest create $(IMAGE) $(IMAGE)-amd64 $(IMAGE)-arm64; \ ) .PHONY: image-manifest-annotate @@ -53,8 +53,17 @@ image-manifest-annotate: $(eval VARIANT := $(word 1,$(subst :, ,$(flavour)))) \ $(eval VARIANT_TAG := $(if $(filter base,$(VARIANT)),$(IMAGE_TAG),$(IMAGE_TAG)-$(VARIANT))) \ $(eval IMAGE := $(IMAGE_REGISTRY)/$(IMAGE_REPO):$(VARIANT_TAG)) \ - docker manifest annotate $(IMAGE) --arch amd64 $(IMAGE)-amd64; \ - docker manifest annotate $(IMAGE) --arch arm64 $(IMAGE)-arm64; \ + docker manifest annotate $(IMAGE) $(IMAGE)-amd64 --arch amd64; \ + docker manifest annotate $(IMAGE) $(IMAGE)-arm64 --arch arm64; \ + ) + +.PHONY: image-manifest-push +image-manifest-push: + $(foreach flavour,$(IMAGE_FLAVOURS),\ + $(eval VARIANT := $(word 1,$(subst :, ,$(flavour)))) \ + $(eval VARIANT_TAG := $(if $(filter base,$(VARIANT)),$(IMAGE_TAG),$(IMAGE_TAG)-$(VARIANT))) \ + $(eval IMAGE := $(IMAGE_REGISTRY)/$(IMAGE_REPO):$(VARIANT_TAG)) \ + docker manifest push $(IMAGE); \ ) ##@ Generation Targets From d5ebfca2ac6c14f1f3317189e850f9f6a0a8deed Mon Sep 17 00:00:00 2001 From: Tyler Gillson Date: Fri, 4 Jul 2025 13:09:37 -0600 Subject: [PATCH 2/3] fix: build correct changelog for initial tags Signed-off-by: Tyler Gillson --- hack/changelog.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/hack/changelog.py b/hack/changelog.py index 3c396ef1..d01fb8dd 100644 --- a/hack/changelog.py +++ b/hack/changelog.py @@ -77,11 +77,15 @@ def section_if_present(changes: [], pr_title): # get related PR from the last release tag last_release_pr = 0 - for tag in tags: - if tag.name == last_release_tag: - tag_pulls = tag.commit.get_pulls() - last_release_pr = tag_pulls[0].number - break + release_word = "in" + + if tags.totalCount > 1: + release_word = "since" + for tag in tags: + if tag.name == last_release_tag: + tag_pulls = tag.commit.get_pulls() + last_release_pr = tag_pulls[0].number + break # collect all PRs from the last release tag features = [] @@ -112,8 +116,8 @@ def section_if_present(changes: [], pr_title): # Print print("# %s %s" % (repo_name, release_tag)) - print("\n**changes since [%s](https://github.com/open-cluster-management-io/releases/%s)**\n" - % (last_release_tag, last_release_tag)) + print("\n**changes %s [%s](https://github.com/open-cluster-management-io/releases/%s)**\n" + % (release_word, last_release_tag, last_release_tag)) section_if_present(breakings, ":warning: Breaking Changes") section_if_present(features, ":sparkles: New Features") section_if_present(bugs, ":bug: Bug Fixes") From e852c7adee239eaf4dc4f451af3066a883f112f2 Mon Sep 17 00:00:00 2001 From: Tyler Gillson Date: Fri, 4 Jul 2025 14:23:36 -0600 Subject: [PATCH 3/3] fix: properly handle arch suffix in IMAGE_TAG that occurs in CI Signed-off-by: Tyler Gillson --- fleetconfig-controller/Makefile | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/fleetconfig-controller/Makefile b/fleetconfig-controller/Makefile index 3dc45eb1..c0307e39 100644 --- a/fleetconfig-controller/Makefile +++ b/fleetconfig-controller/Makefile @@ -21,7 +21,9 @@ IMAGE_FLAVOURS ?= \ # Generate build targets for each variant $(foreach flavour,$(IMAGE_FLAVOURS),\ $(eval VARIANT := $(word 1,$(subst :, ,$(flavour)))) \ - $(eval VARIANT_TAG := $(if $(filter base,$(VARIANT)),$(IMAGE_TAG),$(IMAGE_TAG)-$(VARIANT))) \ + $(eval ARCH_SUFFIX := $(if $(filter %-amd64,$(IMAGE_TAG)),-amd64,$(if $(filter %-arm64,$(IMAGE_TAG)),-arm64,))) \ + $(eval BASE_TAG := $(patsubst %$(ARCH_SUFFIX),%,$(IMAGE_TAG))) \ + $(eval VARIANT_TAG := $(if $(filter base,$(VARIANT)),$(IMAGE_TAG),$(BASE_TAG)-$(VARIANT)$(ARCH_SUFFIX))) \ $(eval DOCKERFILE := $(word 2,$(subst :, ,$(flavour)))) \ $(eval $(call build-image,$(IMAGE_REPO)-$(VARIANT),$(IMAGE_REGISTRY)/$(IMAGE_REPO):$(VARIANT_TAG),$(DOCKERFILE),.)) \ ) @@ -34,15 +36,18 @@ images: $(foreach flavour,$(IMAGE_FLAVOURS),image-$(IMAGE_REPO)-$(word 1,$(subst image-push: $(foreach flavour,$(IMAGE_FLAVOURS),\ $(eval VARIANT := $(word 1,$(subst :, ,$(flavour)))) \ - $(eval VARIANT_TAG := $(if $(filter base,$(VARIANT)),$(IMAGE_TAG),$(IMAGE_TAG)-$(VARIANT))) \ + $(eval ARCH_SUFFIX := $(if $(filter %-amd64,$(IMAGE_TAG)),-amd64,$(if $(filter %-arm64,$(IMAGE_TAG)),-arm64,))) \ + $(eval BASE_TAG := $(patsubst %$(ARCH_SUFFIX),%,$(IMAGE_TAG))) \ + $(eval VARIANT_TAG := $(if $(filter base,$(VARIANT)),$(IMAGE_TAG),$(BASE_TAG)-$(VARIANT)$(ARCH_SUFFIX))) \ docker push $(IMAGE_REGISTRY)/$(IMAGE_REPO):$(VARIANT_TAG); \ ) .PHONY: image-manifest image-manifest: $(foreach flavour,$(IMAGE_FLAVOURS),\ + $(eval IMAGE_TAG_NO_ARCH := $(patsubst %-amd64,%,$(patsubst %-arm64,%,$(IMAGE_TAG)))) \ $(eval VARIANT := $(word 1,$(subst :, ,$(flavour)))) \ - $(eval VARIANT_TAG := $(if $(filter base,$(VARIANT)),$(IMAGE_TAG),$(IMAGE_TAG)-$(VARIANT))) \ + $(eval VARIANT_TAG := $(if $(filter base,$(VARIANT)),$(IMAGE_TAG_NO_ARCH),$(IMAGE_TAG_NO_ARCH)-$(VARIANT))) \ $(eval IMAGE := $(IMAGE_REGISTRY)/$(IMAGE_REPO):$(VARIANT_TAG)) \ docker manifest create $(IMAGE) $(IMAGE)-amd64 $(IMAGE)-arm64; \ ) @@ -50,8 +55,9 @@ image-manifest: .PHONY: image-manifest-annotate image-manifest-annotate: $(foreach flavour,$(IMAGE_FLAVOURS),\ + $(eval IMAGE_TAG_NO_ARCH := $(patsubst %-amd64,%,$(patsubst %-arm64,%,$(IMAGE_TAG)))) \ $(eval VARIANT := $(word 1,$(subst :, ,$(flavour)))) \ - $(eval VARIANT_TAG := $(if $(filter base,$(VARIANT)),$(IMAGE_TAG),$(IMAGE_TAG)-$(VARIANT))) \ + $(eval VARIANT_TAG := $(if $(filter base,$(VARIANT)),$(IMAGE_TAG_NO_ARCH),$(IMAGE_TAG_NO_ARCH)-$(VARIANT))) \ $(eval IMAGE := $(IMAGE_REGISTRY)/$(IMAGE_REPO):$(VARIANT_TAG)) \ docker manifest annotate $(IMAGE) $(IMAGE)-amd64 --arch amd64; \ docker manifest annotate $(IMAGE) $(IMAGE)-arm64 --arch arm64; \ @@ -60,8 +66,9 @@ image-manifest-annotate: .PHONY: image-manifest-push image-manifest-push: $(foreach flavour,$(IMAGE_FLAVOURS),\ + $(eval IMAGE_TAG_NO_ARCH := $(patsubst %-amd64,%,$(patsubst %-arm64,%,$(IMAGE_TAG)))) \ $(eval VARIANT := $(word 1,$(subst :, ,$(flavour)))) \ - $(eval VARIANT_TAG := $(if $(filter base,$(VARIANT)),$(IMAGE_TAG),$(IMAGE_TAG)-$(VARIANT))) \ + $(eval VARIANT_TAG := $(if $(filter base,$(VARIANT)),$(IMAGE_TAG_NO_ARCH),$(IMAGE_TAG_NO_ARCH)-$(VARIANT))) \ $(eval IMAGE := $(IMAGE_REGISTRY)/$(IMAGE_REPO):$(VARIANT_TAG)) \ docker manifest push $(IMAGE); \ )