diff options
author | Luke Meyer <lmeyer@redhat.com> | 2017-05-15 16:09:43 -0400 |
---|---|---|
committer | Luke Meyer <lmeyer@redhat.com> | 2017-05-23 14:16:21 -0400 |
commit | 95df850e7df5b0afb2d7e759582ada6c6fab0df6 (patch) | |
tree | 7691a9b580473ad42581b5d4b54dc5bf5894803a /roles/openshift_health_checker/openshift_checks/disk_availability.py | |
parent | f880dba668ac8bd6de729540e6bf8d07b0ddc8be (diff) | |
download | openshift-95df850e7df5b0afb2d7e759582ada6c6fab0df6.tar.gz openshift-95df850e7df5b0afb2d7e759582ada6c6fab0df6.tar.bz2 openshift-95df850e7df5b0afb2d7e759582ada6c6fab0df6.tar.xz openshift-95df850e7df5b0afb2d7e759582ada6c6fab0df6.zip |
disk/memory checks: make threshold configurable
Diffstat (limited to 'roles/openshift_health_checker/openshift_checks/disk_availability.py')
-rw-r--r-- | roles/openshift_health_checker/openshift_checks/disk_availability.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/disk_availability.py b/roles/openshift_health_checker/openshift_checks/disk_availability.py index c2792a0fe..962148cb8 100644 --- a/roles/openshift_health_checker/openshift_checks/disk_availability.py +++ b/roles/openshift_health_checker/openshift_checks/disk_availability.py @@ -27,10 +27,12 @@ class DiskAvailability(NotContainerizedMixin, OpenShiftCheck): def run(self, tmp, task_vars): group_names = get_var(task_vars, "group_names") ansible_mounts = get_var(task_vars, "ansible_mounts") - - min_free_bytes = max(self.recommended_disk_space_bytes.get(name, 0) for name in group_names) free_bytes = self.openshift_available_disk(ansible_mounts) + recommended_min = max(self.recommended_disk_space_bytes.get(name, 0) for name in group_names) + configured_min = int(get_var(task_vars, "openshift_check_min_host_disk_gb", default=0)) * 10**9 + min_free_bytes = configured_min or recommended_min + if free_bytes < min_free_bytes: return { 'failed': True, |