From 46356330ce1404908b3f78dbe6269c3bd60521b1 Mon Sep 17 00:00:00 2001 From: Ram Lavi Date: Mon, 16 Dec 2024 11:39:50 +0200 Subject: [PATCH] dbg Signed-off-by: Ram Lavi --- Makefile | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 7efbdc13..61424580 100644 --- a/Makefile +++ b/Makefile @@ -95,14 +95,19 @@ docker-push: $(OCI_BIN) push ${TLS_SETTING} ${REGISTRY}/${IMG}:${IMAGE_TAG} @if skopeo inspect docker://${REGISTRY}/${IMG}:${IMAGE_GIT_TAG} >/dev/null 2>&1; then \ echo "Tag '${IMAGE_GIT_TAG}' already exists. Skipping tagging and push."; \ + elif skopeo inspect docker://${REGISTRY}/${IMG}:${IMAGE_GIT_TAG} 2>&1 | grep -q "manifest unknown"; then \ + $(OCI_BIN) tag ${REGISTRY}/${IMG}:${IMAGE_TAG} ${REGISTRY}/${IMG}:${IMAGE_GIT_TAG}; \ + $(OCI_BIN) push ${TLS_SETTING} ${REGISTRY}/${IMG}:${IMAGE_GIT_TAG}; \ else \ - if skopeo inspect docker://${REGISTRY}/${IMG}:${IMAGE_GIT_TAG} 2>&1 | grep -q "manifest unknown"; then \ - $(OCI_BIN) tag ${REGISTRY}/${IMG}:${IMAGE_TAG} ${REGISTRY}/${IMG}:${IMAGE_GIT_TAG}; \ - $(OCI_BIN) push ${TLS_SETTING} ${REGISTRY}/${IMG}:${IMAGE_GIT_TAG}; \ - else \ - echo "Error checking for tag '${IMAGE_GIT_TAG}'. Aborting to avoid potential overwrite."; \ - exit 1; \ - fi; \ + echo "DEBUG: Unexpected error occurred while checking for tag '${IMAGE_GIT_TAG}'. Aborting."; \ + echo "DEBUG: skopeo version:"; \ + skopeo --version; \ + echo "DEBUG1: Running command: skopeo inspect docker://${REGISTRY}/${IMG}:${IMAGE_GIT_TAG}"; \ + skopeo inspect docker://${REGISTRY}/${IMG}:${IMAGE_GIT_TAG}; \ + echo "DEBUG2: Running command: skopeo inspect docker://${REGISTRY}/${IMG}:${IMAGE_GIT_TAG} 2>&1"; \ + skopeo inspect docker://${REGISTRY}/${IMG}:${IMAGE_GIT_TAG} 2>&1; \ + echo "DEBUG3: Running command: skopeo inspect docker://${REGISTRY}/${IMG}:${IMAGE_GIT_TAG} 2>&1 | grep manifest"; \ + skopeo inspect docker://${REGISTRY}/${IMG}:${IMAGE_GIT_TAG} 2>&1 | grep "manifest"; \ fi cluster-up: