agent: support new Docker API Health field (#1475)

This commit is contained in:
henrygd
2026-03-14 15:26:44 -04:00
parent bd94a9d142
commit a7f99e7a8c
2 changed files with 12 additions and 0 deletions

View File

@@ -403,6 +403,14 @@ func (dm *dockerManager) updateContainerStats(ctr *container.ApiInfo, cacheTimeM
stats.Id = ctr.IdShort
statusText, health := parseDockerStatus(ctr.Status)
// Use Health.Status if it's available (Docker API 1.52+; Podman TBD - https://github.com/containers/podman/issues/27786)
if ctr.Health.Status != "" {
if h, ok := container.DockerHealthStrings[ctr.Health.Status]; ok {
health = h
}
}
stats.Status = statusText
stats.Health = health

View File

@@ -10,6 +10,10 @@ type ApiInfo struct {
Status string
State string
Image string
Health struct {
Status string
// FailingStreak int
}
// ImageID string
// Command string
// Created int64