summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker
diff options
context:
space:
mode:
authorLuke Meyer <lmeyer@redhat.com>2017-11-14 15:45:59 -0500
committerLuke Meyer <lmeyer@redhat.com>2017-11-15 16:19:59 -0500
commita80dab78b05b21393587fc99a73e61e6450dddf7 (patch)
tree4d563fb2c4a2f6fe5c99351466fccadf083d10c0 /roles/openshift_health_checker
parent94b5b1cd03f71b5d125d49b210c8ab7754c833c7 (diff)
downloadopenshift-a80dab78b05b21393587fc99a73e61e6450dddf7.tar.gz
openshift-a80dab78b05b21393587fc99a73e61e6450dddf7.tar.bz2
openshift-a80dab78b05b21393587fc99a73e61e6450dddf7.tar.xz
openshift-a80dab78b05b21393587fc99a73e61e6450dddf7.zip
registry-console: align image and check
enable option to configure basename in image docker_image_availability check: follow registry-console image options
Diffstat (limited to 'roles/openshift_health_checker')
-rw-r--r--roles/openshift_health_checker/openshift_checks/docker_image_availability.py16
-rw-r--r--roles/openshift_health_checker/test/docker_image_availability_test.py4
2 files changed, 12 insertions, 8 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/docker_image_availability.py b/roles/openshift_health_checker/openshift_checks/docker_image_availability.py
index 587c6f85c..4f91f6bb3 100644
--- a/roles/openshift_health_checker/openshift_checks/docker_image_availability.py
+++ b/roles/openshift_health_checker/openshift_checks/docker_image_availability.py
@@ -12,15 +12,15 @@ DEPLOYMENT_IMAGE_INFO = {
"origin": {
"namespace": "openshift",
"name": "origin",
- "registry_console_template": "${prefix}kubernetes:${version}",
"registry_console_prefix": "cockpit/",
+ "registry_console_basename": "kubernetes",
"registry_console_default_version": "latest",
},
"openshift-enterprise": {
"namespace": "openshift3",
"name": "ose",
- "registry_console_template": "${prefix}registry-console:${version}",
- "registry_console_prefix": "registry.access.redhat.com/openshift3/",
+ "registry_console_prefix": "openshift3/",
+ "registry_console_basename": "registry-console",
"registry_console_default_version": "${short_version}",
},
}
@@ -156,7 +156,8 @@ class DockerImageAvailability(DockerHostMixin, OpenShiftCheck):
if 'oo_nodes_to_config' in host_groups:
for suffix in NODE_IMAGE_SUFFIXES:
required.add(image_url.replace("${component}", suffix).replace("${version}", image_tag))
- required.add(self._registry_console_image(image_tag, image_info))
+ if self.get_var("osm_use_cockpit", default=True, convert=bool):
+ required.add(self._registry_console_image(image_tag, image_info))
# images for containerized components
if self.get_var("openshift", "common", "is_containerized"):
@@ -180,6 +181,10 @@ class DockerImageAvailability(DockerHostMixin, OpenShiftCheck):
"openshift_cockpit_deployer_prefix",
default=image_info["registry_console_prefix"],
)
+ basename = self.get_var(
+ "openshift_cockpit_deployer_basename",
+ default=image_info["registry_console_basename"],
+ )
# enterprise template just uses v3.6, v3.7, etc
match = re.match(r'v\d+\.\d+', image_tag)
@@ -187,8 +192,7 @@ class DockerImageAvailability(DockerHostMixin, OpenShiftCheck):
version = image_info["registry_console_default_version"].replace("${short_version}", short_version)
version = self.get_var("openshift_cockpit_deployer_version", default=version)
- template = image_info["registry_console_template"]
- return template.replace('${prefix}', prefix).replace('${version}', version)
+ return prefix + basename + ':' + version
def local_images(self, images):
"""Filter a list of images and return those available locally."""
diff --git a/roles/openshift_health_checker/test/docker_image_availability_test.py b/roles/openshift_health_checker/test/docker_image_availability_test.py
index 484aa72e0..ec46c3b4b 100644
--- a/roles/openshift_health_checker/test/docker_image_availability_test.py
+++ b/roles/openshift_health_checker/test/docker_image_availability_test.py
@@ -217,7 +217,7 @@ def test_registry_availability(image, registries, connection_test_failed, skopeo
'foo.io/openshift3/ose-docker-registry:f13ac45',
'foo.io/openshift3/ose-haproxy-router:f13ac45',
# registry-console is not constructed/versioned the same as the others.
- 'registry.access.redhat.com/openshift3/registry-console:vtest',
+ 'openshift3/registry-console:vtest',
# containerized images aren't built from oreg_url
'openshift3/node:vtest',
'openshift3/openvswitch:vtest',
@@ -261,7 +261,7 @@ def test_required_images(deployment_type, is_containerized, groups, oreg_url, ex
openshift_deployment_type="openshift-enterprise",
openshift_image_tag="vtest",
),
- "registry.access.redhat.com/openshift3/registry-console:vtest",
+ "openshift3/registry-console:vtest",
), (
dict(
openshift_deployment_type="openshift-enterprise",