diff --git a/artbotlib/brew_list.py b/artbotlib/brew_list.py index e569c67..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.svc.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..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('registry.ci.openshift.org/ocp/release:', '') - release_img = release_img.replace('quay.io/openshift-release-dev/ocp-release:', '') + 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]