From f60a331c1d19014f765798d4cb8233faea0005d0 Mon Sep 17 00:00:00 2001 From: Ximin han Date: Mon, 8 Apr 2024 17:04:47 +0800 Subject: [PATCH 1/3] Update brew_list.py --- artbotlib/brew_list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artbotlib/brew_list.py b/artbotlib/brew_list.py index e569c67..d1866be 100644 --- a/artbotlib/brew_list.py +++ b/artbotlib/brew_list.py @@ -143,7 +143,7 @@ def list_component_data_for_release_tag(so, data_type, release_tag): so.say('Let me look into that. It may take a minute...') if 'nightly-' in release_tag: - repo_url = 'registry.svc.ci.openshift.org/ocp/release' + repo_url = 'registry.ci.openshift.org/ocp/release' else: repo_url = 'quay.io/openshift-release-dev/ocp-release' From af075f51a57cabed5273b6a39d5e43d4d2953dce Mon Sep 17 00:00:00 2001 From: ximhan Date: Mon, 8 Apr 2024 18:01:28 +0800 Subject: [PATCH 2/3] use constatnts --- artbotlib/brew_list.py | 6 +++--- artbotlib/constants.py | 4 ++++ artbotlib/rhcos.py | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/artbotlib/brew_list.py b/artbotlib/brew_list.py index d1866be..5432fc5 100644 --- a/artbotlib/brew_list.py +++ b/artbotlib/brew_list.py @@ -14,7 +14,7 @@ import artbotlib.exectools from . import util -from .constants import RHCOS_BASE_URL +from .constants import NIGHTLY_REGISTRY, QUAY_REGISTRY from .rhcos import RHCOSBuildInfo logger = logging.getLogger(__name__) @@ -143,9 +143,9 @@ def list_component_data_for_release_tag(so, data_type, release_tag): so.say('Let me look into that. It may take a minute...') if 'nightly-' in release_tag: - repo_url = 'registry.ci.openshift.org/ocp/release' + repo_url = NIGHTLY_REGISTRY else: - repo_url = 'quay.io/openshift-release-dev/ocp-release' + repo_url = QUAY_REGISTRY image_url = f'{repo_url}:{release_tag}-x86_64' diff --git a/artbotlib/constants.py b/artbotlib/constants.py index 1373b0e..44fe3b0 100644 --- a/artbotlib/constants.py +++ b/artbotlib/constants.py @@ -35,6 +35,10 @@ PROW_BASE_URL = 'https://prow.ci.openshift.org' +NIGHTLY_REGISTRY = 'registry.ci.openshift.org/ocp/release' + +QUAY_REGISTRY = 'quay.io/openshift-release-dev/ocp-release' + # Release Controller and RHCOS browser call arches in different ways; # these two dictionaries easily map names from/to one namespace to the other RC_ARCH_TO_RHCOS_ARCH = { diff --git a/artbotlib/rhcos.py b/artbotlib/rhcos.py index 962ee87..b6c28c9 100644 --- a/artbotlib/rhcos.py +++ b/artbotlib/rhcos.py @@ -95,8 +95,8 @@ async def get_rhcos_build_id_from_release(release_img: str, arch: str) -> str: logger.info('Retrieving rhcos build ID for %s', release_img) # Make sure only the release tag is being used - release_img = release_img.replace('registry.ci.openshift.org/ocp/release:', '') - release_img = release_img.replace('quay.io/openshift-release-dev/ocp-release:', '') + release_img = release_img.replace(constants.NIGHTLY_REGISTRY, '') + release_img = release_img.replace(constants.QUAY_REGISTRY, '') # Arch shouldn't be in the name rhcos_arch = constants.RC_ARCH_TO_RHCOS_ARCH[arch] From 5389445cd7f721755034ba8485b41bc85769d473 Mon Sep 17 00:00:00 2001 From: ximhan Date: Mon, 8 Apr 2024 18:46:10 +0800 Subject: [PATCH 3/3] fix url --- artbotlib/rhcos.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artbotlib/rhcos.py b/artbotlib/rhcos.py index b6c28c9..c5353f9 100644 --- a/artbotlib/rhcos.py +++ b/artbotlib/rhcos.py @@ -95,8 +95,8 @@ async def get_rhcos_build_id_from_release(release_img: str, arch: str) -> str: logger.info('Retrieving rhcos build ID for %s', release_img) # Make sure only the release tag is being used - release_img = release_img.replace(constants.NIGHTLY_REGISTRY, '') - release_img = release_img.replace(constants.QUAY_REGISTRY, '') + release_img = release_img.replace(f"{constants.NIGHTLY_REGISTRY}:", '') + release_img = release_img.replace(f"{constants.QUAY_REGISTRY}:", '') # Arch shouldn't be in the name rhcos_arch = constants.RC_ARCH_TO_RHCOS_ARCH[arch]