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 ++-- .../notes/fix-container-healthy-checks-4ecdbe67e07819aa.yaml | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/fix-container-healthy-checks-4ecdbe67e07819aa.yaml 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: > diff --git a/releasenotes/notes/fix-container-healthy-checks-4ecdbe67e07819aa.yaml b/releasenotes/notes/fix-container-healthy-checks-4ecdbe67e07819aa.yaml new file mode 100644 index 000000000..2fdba6fcf --- /dev/null +++ b/releasenotes/notes/fix-container-healthy-checks-4ecdbe67e07819aa.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes kolla-ansible check skip unhealthy containers. + `LP#2156900 `__ -- cgit v1.2.3