diff options
author | juanvallejo <jvallejo@redhat.com> | 2017-06-20 19:07:56 -0400 |
---|---|---|
committer | juanvallejo <jvallejo@redhat.com> | 2017-07-20 15:17:05 -0400 |
commit | ede03746b10a5e775c2389cc97c4b5e49c75da07 (patch) | |
tree | 4ed22483d4839b9247386232dd1951b67fb060bd /roles/openshift_health_checker/openshift_checks/logging/logging.py | |
parent | 0b0e0d1ec88af89f6315e1602b30ffe5218c88dc (diff) | |
download | openshift-ede03746b10a5e775c2389cc97c4b5e49c75da07.tar.gz openshift-ede03746b10a5e775c2389cc97c4b5e49c75da07.tar.bz2 openshift-ede03746b10a5e775c2389cc97c4b5e49c75da07.tar.xz openshift-ede03746b10a5e775c2389cc97c4b5e49c75da07.zip |
verify sane log times in logging stack
This patch verifies that logs sent from logging pods can be queried on
the Elasticsearch pod within a reasonable amount of time.
Diffstat (limited to 'roles/openshift_health_checker/openshift_checks/logging/logging.py')
-rw-r--r-- | roles/openshift_health_checker/openshift_checks/logging/logging.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/logging/logging.py b/roles/openshift_health_checker/openshift_checks/logging/logging.py index 05b4d300c..1fddcd6f6 100644 --- a/roles/openshift_health_checker/openshift_checks/logging/logging.py +++ b/roles/openshift_health_checker/openshift_checks/logging/logging.py @@ -12,20 +12,21 @@ class LoggingCheck(OpenShiftCheck): """Base class for logging component checks""" name = "logging" + logging_namespace = "logging" @classmethod def is_active(cls, task_vars): - return super(LoggingCheck, cls).is_active(task_vars) and cls.is_first_master(task_vars) + logging_deployed = get_var(task_vars, "openshift_hosted_logging_deploy", default=False) + return super(LoggingCheck, cls).is_active(task_vars) and cls.is_first_master(task_vars) and logging_deployed @staticmethod def is_first_master(task_vars): - """Run only on first master and only when logging is configured. Returns: bool""" - logging_deployed = get_var(task_vars, "openshift_hosted_logging_deploy", default=True) + """Run only on first master. Returns: bool""" # Note: It would be nice to use membership in oo_first_master group, however for now it # seems best to avoid requiring that setup and just check this is the first master. hostname = get_var(task_vars, "ansible_ssh_host") or [None] masters = get_var(task_vars, "groups", "masters", default=None) or [None] - return logging_deployed and masters[0] == hostname + return masters and masters[0] == hostname def run(self, tmp, task_vars): pass @@ -45,7 +46,7 @@ class LoggingCheck(OpenShiftCheck): raise ValueError() except ValueError: # successful run but non-parsing data generally means there were no pods in the namespace - return None, 'There are no pods in the {} namespace. Is logging deployed?'.format(namespace) + return None, 'No pods were found for the "{}" logging component.'.format(logging_component) return pods['items'], None |