From 6c486d2f9c033f5484f06eb1da9ad369ca81c254 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 7 Oct 2026 20:40:56 -0400 Subject: [PATCH] fix(docker): keep the space before a heading's restarting/unhealthy count (#5214) Co-Authored-By: Claude Opus 5.5 --- plugins/docker/templates/docker/rows.html | 4 ++-- tests/plugins/docker/test_docker_page.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/docker/templates/docker/rows.html b/plugins/docker/templates/docker/rows.html index 9a9b37d..1971211 100644 --- a/plugins/docker/templates/docker/rows.html +++ b/plugins/docker/templates/docker/rows.html @@ -29,8 +29,8 @@ {% if attention or failing_services %}

Needs attention {{ problems }} - {%- if unhealthy %} · {{ unhealthy }} unhealthy{% endif %} - {%- if restarting %} · {{ restarting }} restarting{% endif %}

+ {%- if unhealthy %} · {{ unhealthy }} unhealthy{% endif %} + {%- if restarting %} · {{ restarting }} restarting{% endif %}
    {# A swarm service in trouble: Swarm replaces its failed tasks, so the service, not any one container, is what is failing. #} diff --git a/tests/plugins/docker/test_docker_page.py b/tests/plugins/docker/test_docker_page.py index 3f908de..c192188 100644 --- a/tests/plugins/docker/test_docker_page.py +++ b/tests/plugins/docker/test_docker_page.py @@ -75,7 +75,7 @@ async def test_a_crash_loop_comes_first_and_a_stale_row_says_so(app): # #5298: the verdict first; each problem section carries its own count (#5214). assert page.index('class="docker-verdict"') < page.index("Needs attention") assert "1 needs attention" in page and "1 container running, 1 stopped" in page - assert "unhealthy" not in page and "Failed in the last 24h" not in page and "stat-strip" not in page + assert " unhealthy" not in page and "Failed in the last 24h" not in page and "stat-strip" not in page card = page[page.index("Needs attention"):page.index("
")] assert 'Restarting' in card assert 'href="/plugins/docker/container/h1/api" title="api">api' in card @@ -84,8 +84,8 @@ async def test_a_crash_loop_comes_first_and_a_stale_row_says_so(app): assert "cache" not in card assert page.index("Needs attention") < page.index("1 ' - '· 1 restarting') in card + assert ('Needs attention 1' + ' · 1 restarting') in card assert '">1 stale' in page[:page.index("

")] # stale sits in the verdict assert 'class="badge badge-warn" title="Last report' in page # the stale row # CPU in cores, toned by its share of the host's CPUs through Settings → Thresholds.