From 15ce36696a21356eb59abb4473e210f13cf7c98c Mon Sep 17 00:00:00 2001 From: Kuchinskiy Alexey Date: Fri, 5 Jun 2026 14:55:21 +0300 Subject: Fix container unhealthy checks An issue with skipping "healthy check" checks has been resolved. In task "Fail if containers are unhealthy" in variable "unhealthy_containers" not appending services with status "unhealthy", because path to the status incorrect, and search in filter "selectattr" not work. Tasks skiping, because in variable "unhealthy_containers" not items. Closes-Bug: #2156900 Change-Id: I52f78774536e4487c38a500c2c8941eae4386604 Signed-off-by: Kuchinskiy Alexey (cherry picked from commit d30fad4325b80cc82f485a979c0afeaf7647b07f) --- ansible/roles/service-check/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ansible') diff --git a/ansible/roles/service-check/tasks/main.yml b/ansible/roles/service-check/tasks/main.yml index 9f4cf30af..9cb17ad09 100644 --- a/ansible/roles/service-check/tasks/main.yml +++ b/ansible/roles/service-check/tasks/main.yml @@ -28,8 +28,8 @@ unhealthy_containers: >- {{ container_facts.containers | dict2items | - selectattr("value.Status", "defined") | - selectattr("value.Status", "search", "unhealthy") | + selectattr("value.State.Health", "defined") | + selectattr("value.State.Health.Status", "search", "unhealthy") | map(attribute='key') | list }} ansible.builtin.fail: msg: > -- cgit v1.2.3