mirror of
https://github.com/henrygd/beszel.git
synced 2026-03-21 21:26:16 +01:00
agent: support new Docker API Health field (#1475)
This commit is contained in:
@@ -403,6 +403,14 @@ func (dm *dockerManager) updateContainerStats(ctr *container.ApiInfo, cacheTimeM
|
|||||||
stats.Id = ctr.IdShort
|
stats.Id = ctr.IdShort
|
||||||
|
|
||||||
statusText, health := parseDockerStatus(ctr.Status)
|
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.Status = statusText
|
||||||
stats.Health = health
|
stats.Health = health
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ type ApiInfo struct {
|
|||||||
Status string
|
Status string
|
||||||
State string
|
State string
|
||||||
Image string
|
Image string
|
||||||
|
Health struct {
|
||||||
|
Status string
|
||||||
|
// FailingStreak int
|
||||||
|
}
|
||||||
// ImageID string
|
// ImageID string
|
||||||
// Command string
|
// Command string
|
||||||
// Created int64
|
// Created int64
|
||||||
|
|||||||
Reference in New Issue
Block a user