Skip to content

Commit 3e0e918

Browse files
r-krcekAlex-Welsh
authored andcommitted
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>
1 parent 2916015 commit 3e0e918

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ansible/library/kolla_container_facts.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ def get_containers(self):
120120
container_name = container.name
121121
if names and container_name not in names:
122122
continue
123+
# NOTE(r-krcek): For performance reasons don't include
124+
# healthcheck logs. It can contain MBs worth of data!
125+
container.attrs["State"].get("Health", dict()).pop("Log", None)
123126
self.result['containers'][container_name] = container.attrs
124127

125128
def get_containers_state(self):

0 commit comments

Comments
 (0)