aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Krček <roman.krcek@tietoevry.com>2025-02-14 14:26:26 +0000
committerRoman Krček <roman.krcek@tietoevry.com>2025-02-14 14:26:26 +0000
commit2e99f855387448211cbc1aec3b531a7c6487928d (patch)
tree86015915394e156ac18bdf6d39cfd97066bcb7eb
parentb076618aae1b288a39e444ced755b311834c9fb6 (diff)
downloadkolla-ansible-2e99f855387448211cbc1aec3b531a7c6487928d.tar.gz
kolla-ansible-2e99f855387448211cbc1aec3b531a7c6487928d.zip
Fix kolla_container_facts performance
If a container has been running for some time, it will accumulate MBs worth of healthcheck logs that kolla_container_facts module will forward to ansible when action "get_container" is called. That causes the execution of this module to slow down considerably. Change-Id: I6b11672ba093c65cef4d20f8ef716e459c2a92c3 Signed-off-by: Roman Krček <roman.krcek@tietoevry.com>
-rw-r--r--ansible/library/kolla_container_facts.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ansible/library/kolla_container_facts.py b/ansible/library/kolla_container_facts.py
index fcd2afb59..041aa3904 100644
--- a/ansible/library/kolla_container_facts.py
+++ b/ansible/library/kolla_container_facts.py
@@ -120,6 +120,9 @@ class ContainerFactsWorker():
container_name = container.name
if names and container_name not in names:
continue
+ # NOTE(r-krcek): For performance reasons don't include
+ # healthcheck logs. It can contain MBs worth of data!
+ container.attrs["State"].get("Health", dict()).pop("Log", None)
self.result['containers'][container_name] = container.attrs
def get_containers_state(self):