From e495b1ef2bb3c4dca20b27b31685e4dadbae5213 Mon Sep 17 00:00:00 2001 From: Filip Brychta Date: Wed, 22 Apr 2026 09:01:29 +0200 Subject: [PATCH 1/2] Using crane instead of skopeo which is not available in the build-tools image Skopeo is not available in the build-tools image so the check was failing because of that. It will work with crane Signed-off-by: Filip Brychta --- .github/workflows/release.yaml | 5 ----- Makefile.core.mk | 8 ++++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d44689fc7..797f70f47 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -38,11 +38,6 @@ jobs: - uses: actions/checkout@v4 - - name: Install skopeo - run: | - sudo apt-get update - sudo apt-get install -y skopeo - # this should avoid ERROR: failed to build: failed to read GITHUB_EVENT_PATH "/home/runner/work/_temp/_github_workflow/event.json" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/Makefile.core.mk b/Makefile.core.mk index 63f3a10ea..6a4cb0250 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -319,8 +319,8 @@ endif docker-buildx: build-all ## Build and push docker image with cross-platform support. ifeq ($(PREVENT_IMAGE_OVERWRITE),true) @echo "Checking if image ${IMAGE} already exists..." - @if command -v skopeo >/dev/null 2>&1; then \ - if skopeo inspect docker://${IMAGE} >/dev/null 2>&1; then \ + @if command -v crane >/dev/null 2>&1; then \ + if crane manifest ${IMAGE} >/dev/null 2>&1; then \ echo "ERROR: Image tag ${IMAGE} already exists in the registry!"; \ echo "Please ensure you are releasing a new version."; \ exit 1; \ @@ -328,8 +328,8 @@ ifeq ($(PREVENT_IMAGE_OVERWRITE),true) echo "Image tag ${IMAGE} does not exist. Proceeding with build and push."; \ fi; \ else \ - echo "ERROR: skopeo is not installed. Cannot verify if image already exists."; \ - echo "Install skopeo or set PREVENT_IMAGE_OVERWRITE=false to skip this check."; \ + echo "ERROR: crane is not installed. Cannot verify if image already exists."; \ + echo "Install crane or set PREVENT_IMAGE_OVERWRITE=false to skip this check."; \ exit 1; \ fi endif From 3fc727a4cbb539cad4bf2d18a87ff0261ca88140 Mon Sep 17 00:00:00 2001 From: Filip Brychta Date: Wed, 22 Apr 2026 09:45:08 +0200 Subject: [PATCH 2/2] Improve error handeling Signed-off-by: Filip Brychta --- Makefile.core.mk | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile.core.mk b/Makefile.core.mk index 6a4cb0250..9fcf92189 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -320,12 +320,19 @@ docker-buildx: build-all ## Build and push docker image with cross-platform supp ifeq ($(PREVENT_IMAGE_OVERWRITE),true) @echo "Checking if image ${IMAGE} already exists..." @if command -v crane >/dev/null 2>&1; then \ - if crane manifest ${IMAGE} >/dev/null 2>&1; then \ + set +e; \ + OUTPUT=$$(crane manifest ${IMAGE} 2>&1); \ + EXIT_CODE=$$?; \ + set -e; \ + if echo "$$OUTPUT" | grep -q "MANIFEST_UNKNOWN"; then \ + echo "Image tag ${IMAGE} does not exist. Proceeding with build and push."; \ + elif [ $$EXIT_CODE -eq 0 ]; then \ echo "ERROR: Image tag ${IMAGE} already exists in the registry!"; \ echo "Please ensure you are releasing a new version."; \ exit 1; \ else \ - echo "Image tag ${IMAGE} does not exist. Proceeding with build and push."; \ + echo "ERROR: Failed to check if image exists: $$OUTPUT"; \ + exit 1; \ fi; \ else \ echo "ERROR: crane is not installed. Cannot verify if image already exists."; \