From 75241357dc6234fd48a7abeb1d88b5709dcc5f80 Mon Sep 17 00:00:00 2001 From: Daniel Ferreira Date: Mon, 23 Sep 2024 15:44:59 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Add=20special=20case=20we?= =?UTF-8?q?re=20registry=20is=20defined=20for=20library=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 4 ++-- app/imageswap/imageswap.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 01b97e9..a7fdaa5 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,8 @@ # NOTE: The version for both `imageswap-init` and `imageswap` should be identical for now. # Some effort will need to be put in to be able to distringuish changes to one vs. the other # in CI/Release steps. -IMAGESWAP_VERSION := v1.5.3 -IMAGESWAP_INIT_VERSION := v1.5.3 +IMAGESWAP_VERSION := v1.5.4 +IMAGESWAP_INIT_VERSION := v1.5.4 REPO_ROOT := $(CURDIR) APP_NAME ?= "imageswap.py" diff --git a/app/imageswap/imageswap.py b/app/imageswap/imageswap.py index 3976cab..0249622 100755 --- a/app/imageswap/imageswap.py +++ b/app/imageswap/imageswap.py @@ -274,6 +274,12 @@ def swap_image(container_spec): no_registry = False library_image = False + # special case when the image is a library image but also has docker.io + # example: 'docker.io/alpine:latest' + if image_split[0] == "docker.io" and "/" not in image_split[2]: + image = image.replace("docker.io/", "") + image_split = image.partition("/") + # Check if first section is a Registry URL if "." in image_split[0] and image_split[1] != "" and image_split[2] != "": image_registry = image_split[0]