summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker/openshift_checks
diff options
context:
space:
mode:
authorLuke Meyer <lmeyer@redhat.com>2018-01-25 13:43:34 -0500
committerLuke Meyer <lmeyer@redhat.com>2018-01-25 20:49:16 -0500
commit4d4a628c626f40e6f567d189c2f46f43cb516f0e (patch)
treefc1b1e22d1d1ff6578d718af3ae0e2a09ba1414a /roles/openshift_health_checker/openshift_checks
parent6c921b0877c38c2a6e55cd5852a740ec88fde8fb (diff)
downloadopenshift-4d4a628c626f40e6f567d189c2f46f43cb516f0e.tar.gz
openshift-4d4a628c626f40e6f567d189c2f46f43cb516f0e.tar.bz2
openshift-4d4a628c626f40e6f567d189c2f46f43cb516f0e.tar.xz
openshift-4d4a628c626f40e6f567d189c2f46f43cb516f0e.zip
docker_image_availability: containerized overrides
Respect container image name override variables.
Diffstat (limited to 'roles/openshift_health_checker/openshift_checks')
-rw-r--r--roles/openshift_health_checker/openshift_checks/docker_image_availability.py21
1 files changed, 13 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 d298fbab2..145b82491 100644
--- a/roles/openshift_health_checker/openshift_checks/docker_image_availability.py
+++ b/roles/openshift_health_checker/openshift_checks/docker_image_availability.py
@@ -171,16 +171,21 @@ class DockerImageAvailability(DockerHostMixin, OpenShiftCheck):
required.add(self._registry_console_image(image_tag, image_info))
# images for containerized components
- if self.get_var("openshift_is_containerized"):
- components = set()
+ def add_var_or_default_img(var_name, comp_name):
+ """Returns: default image from comp_name, overridden by var_name in task_vars"""
+ default = "{}/{}:{}".format(image_info["namespace"], comp_name, image_tag)
+ required.add(self.template_var(self.get_var(var_name, default=default)))
+
+ if self.get_var("openshift_is_containerized", convert=bool):
if 'oo_nodes_to_config' in host_groups:
- components.update(["node", "openvswitch"])
+ add_var_or_default_img("osn_image", "node")
+ add_var_or_default_img("osn_ovs_image", "openvswitch")
if 'oo_masters_to_config' in host_groups: # name is "origin" or "ose"
- components.add(image_info["name"])
- for component in components:
- required.add("{}/{}:{}".format(image_info["namespace"], component, image_tag))
- if 'oo_etcd_to_config' in host_groups: # special case, note it is the same for origin/enterprise
- required.add("registry.access.redhat.com/rhel7/etcd") # and no image tag
+ add_var_or_default_img("osm_image", image_info["name"])
+ if 'oo_etcd_to_config' in host_groups:
+ # special case, note default is the same for origin/enterprise and has no image tag
+ etcd_img = self.get_var("osm_etcd_image", default="registry.access.redhat.com/rhel7/etcd")
+ required.add(self.template_var(etcd_img))
return required