aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ansible/roles/service-check/tasks/main.yml4
-rw-r--r--releasenotes/notes/fix-container-healthy-checks-4ecdbe67e07819aa.yaml5
-rw-r--r--releasenotes/notes/fix-proxysql-database-internal-tls-b401e564ec39a633.yaml2
-rwxr-xr-xtests/check-failure.sh30
4 files changed, 31 insertions, 10 deletions
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 <https://bugs.launchpad.net/kolla-ansible/+bug/2156900>`__
diff --git a/releasenotes/notes/fix-proxysql-database-internal-tls-b401e564ec39a633.yaml b/releasenotes/notes/fix-proxysql-database-internal-tls-b401e564ec39a633.yaml
index fb3fb9db9..238a5e583 100644
--- a/releasenotes/notes/fix-proxysql-database-internal-tls-b401e564ec39a633.yaml
+++ b/releasenotes/notes/fix-proxysql-database-internal-tls-b401e564ec39a633.yaml
@@ -6,7 +6,7 @@ fixes:
certificates (e.g. use of intermediate certificates).
Users who are affected by this bug needs to create a file
- ``proxysql-ca.pem`` at ``certificates_internal_dir``.
+ ``proxysql-ca.pem`` at ``kolla_certificates_dir``.
This file needs to be a copy of the intermediate certificate (i.e.
certificate that signed database internal TLS)
diff --git a/tests/check-failure.sh b/tests/check-failure.sh
index 19d2f071f..ecd3a10ac 100755
--- a/tests/check-failure.sh
+++ b/tests/check-failure.sh
@@ -6,13 +6,25 @@ set -o errexit
# Enable unbuffered output for Ansible in Jenkins.
export PYTHONUNBUFFERED=1
+# neutron_agents_wrappers (see ansible/roles/neutron) spawns per-namespace
+# helper containers (dnsmasq/haproxy/keepalived) that are not managed by
+# Kolla and can be created/removed by Neutron independently of the deploy,
+# e.g. neutron_dhcp_agent_dnsmasq_qdhcp-<uuid>. Ignore them in these checks.
+IGNORE_CONTAINERS_REGEX='_(qdhcp|qrouter|ovnmeta)-'
+
+filter_unmanaged_containers() {
+ grep -Ev "$IGNORE_CONTAINERS_REGEX" || true
+}
+
check_podman_failures() {
failed_containers=$(sudo podman ps -a --format "{{.Names}}" \
--filter status=created \
- --filter status=paused \
--filter status=exited \
- --filter status=unknown)
+ --filter status=paused \
+ --filter status=removing \
+ --filter status=unknown \
+ | filter_unmanaged_containers)
for container in $failed_containers; do
sudo podman inspect $container
@@ -28,7 +40,8 @@ check_podman_unhealthies() {
done
unhealthy_containers=$(sudo podman ps -a --format "{{.Names}}" \
- --filter health=unhealthy)
+ --filter health=unhealthy \
+ | filter_unmanaged_containers)
for container in $unhealthy_containers; do
echo "Discovered unhealthy container: $container"
@@ -50,10 +63,12 @@ check_docker_failures() {
# are treated as failure.
failed_containers=$(sudo docker ps -a --format "{{.Names}}" \
--filter status=created \
- --filter status=restarting \
- --filter status=paused \
--filter status=exited \
- --filter status=dead)
+ --filter status=dead \
+ --filter status=paused \
+ --filter status=removing \
+ --filter status=restarting \
+ | filter_unmanaged_containers)
for container in $failed_containers; do
sudo docker inspect $container
@@ -69,7 +84,8 @@ check_docker_unhealthies() {
done
unhealthy_containers=$(sudo docker ps -a --format "{{.Names}}" \
- --filter health=unhealthy)
+ --filter health=unhealthy \
+ | filter_unmanaged_containers)
for container in $unhealthy_containers; do
echo "Discovered unhealthy container: $container"