Skip to content

Modernize CheckDocker and add stats, restarts and disk-usage checks - #1400

Merged
mickem merged 2 commits into
mainfrom
feature/modernized_docker_2
Aug 13, 2026
Merged

Modernize CheckDocker and add stats, restarts and disk-usage checks#1400
mickem merged 2 commits into
mainfrom
feature/modernized_docker_2

Conversation

@mickem

@mickem mickem commented Aug 12, 2026

Copy link
Copy Markdown
Owner

No description provided.

mickem added 2 commits August 12, 2026 20:44
The module had never worked on Linux: the http client had no unix domain
socket transport, so the "pipe" protocol fell back to TCP and tried to
DNS-resolve /var/run/docker.sock. It had also stopped working on current
daemons on Windows, which reject its pinned /v1.40 API prefix (minimum is
1.41 now), and any failure was swallowed into an empty WARNING.

- net/http: new unix_socket transport (with the same read/write deadlines as
  TCP); "pipe" now means named pipe on Windows and unix socket elsewhere.
- check_docker: unversioned API paths (accepted by every daemon and podman's
  compat API); UNKNOWN with the transport error instead of an empty WARNING;
  tolerant JSON parsing (sparse payloads no longer throw); all=true to
  include stopped containers; container=<name> require-semantics with a
  synthetic 'missing' state; new keywords health, has_health_check, ports,
  labels, created, multi-network ip; /settings/docker endpoint + timeout.
- New check_docker_info: daemon health from /info (version plus
  container/image counts with perf data).
- New check_docker_stats: per-container CPU%% and memory versus limit,
  computed like docker stats (cgroup v1 and v2).
- New check_docker_restarts: crash-loop and OOM detection; default warning
  on restart_count > 3 with a recent start, critical on oom_killed.
- New check_docker_df: docker system df as a check, with reclaimable-space
  keywords; size thresholds accept units (total_reclaimable > 10G).
- Ship CheckDocker.dll in the MSI and add it to the feature-hint map; drop
  the dead log/metrics stubs.

Covered by 24 unit tests (canned daemon payloads via an injectable fetcher)
and a 13-case integration suite against a real daemon; all scenarios also
verified live against Docker 29.5.3, including a real crash-looping
container.

Assisted-by: Claude Code:claude-fable-5
Signed-off-by: Michael Medin <michael@medin.name>
The CheckDocker unit tests configured /var/run/docker.sock as the daemon
endpoint on every platform. Since the checks validate the endpoint before
they call the (injected) fetcher, on Windows all 23 fake-daemon tests were
refused with "only a local named pipe ... is allowed" and never reached the
canned payloads, failing the three Windows CI builds.

Configure the endpoint from default_docker_endpoint() instead, which is the
unix socket path elsewhere and \\.\pipe\docker_engine on Windows, and
derive the expected connect-failure message from it too.

Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Michael Medin <michael@medin.name>
@mickem
mickem merged commit f9a169f into main Aug 13, 2026
29 checks passed
@mickem
mickem deleted the feature/modernized_docker_2 branch August 13, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant