summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Meyer <lmeyer@redhat.com>2017-10-04 10:35:08 -0400
committerLuke Meyer <lmeyer@redhat.com>2017-10-04 10:53:21 -0400
commit776b0d9478d92c11c5dd285c758ffae668674f8e (patch)
treec81e188bfa9595e57a36f40fa710dd2eada6c5a0
parent7edc17b56309d259634331527bf5f343f45baeaf (diff)
downloadopenshift-776b0d9478d92c11c5dd285c758ffae668674f8e.tar.gz
openshift-776b0d9478d92c11c5dd285c758ffae668674f8e.tar.bz2
openshift-776b0d9478d92c11c5dd285c758ffae668674f8e.tar.xz
openshift-776b0d9478d92c11c5dd285c758ffae668674f8e.zip
openshift_checks: lb and nfs do not need docker
fixes bug 1496760 https://bugzilla.redhat.com/show_bug.cgi?id=1496760
-rw-r--r--roles/openshift_health_checker/openshift_checks/mixins.py8
-rw-r--r--roles/openshift_health_checker/test/docker_image_availability_test.py4
2 files changed, 7 insertions, 5 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/mixins.py b/roles/openshift_health_checker/openshift_checks/mixins.py
index f175b86ad..cfbdea303 100644
--- a/roles/openshift_health_checker/openshift_checks/mixins.py
+++ b/roles/openshift_health_checker/openshift_checks/mixins.py
@@ -21,9 +21,11 @@ class DockerHostMixin(object):
def is_active(self):
"""Only run on hosts that depend on Docker."""
- is_containerized = self.get_var("openshift", "common", "is_containerized")
- is_node = "oo_nodes_to_config" in self.get_var("group_names", default=[])
- return super(DockerHostMixin, self).is_active() and (is_containerized or is_node)
+ group_names = set(self.get_var("group_names", default=[]))
+ needs_docker = set(["oo_nodes_to_config"])
+ if self.get_var("openshift.common.is_containerized"):
+ needs_docker.update(["oo_masters_to_config", "oo_etcd_to_config"])
+ return super(DockerHostMixin, self).is_active() and bool(group_names.intersection(needs_docker))
def ensure_dependencies(self):
"""
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 25efbda69..43dcf0c9a 100644
--- a/roles/openshift_health_checker/test/docker_image_availability_test.py
+++ b/roles/openshift_health_checker/test/docker_image_availability_test.py
@@ -21,14 +21,14 @@ def task_vars():
@pytest.mark.parametrize('deployment_type, is_containerized, group_names, expect_active', [
- ("origin", True, [], True),
- ("openshift-enterprise", True, [], True),
("invalid", True, [], False),
("", True, [], False),
("origin", False, [], False),
("openshift-enterprise", False, [], False),
("origin", False, ["oo_nodes_to_config", "oo_masters_to_config"], True),
("openshift-enterprise", False, ["oo_etcd_to_config"], False),
+ ("origin", True, ["nfs"], False),
+ ("openshift-enterprise", True, ["lb"], False),
])
def test_is_active(task_vars, deployment_type, is_containerized, group_names, expect_active):
task_vars['openshift_deployment_type'] = deployment_type