summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-09-23 11:34:42 -0400
committerGitHub <noreply@github.com>2021-09-23 11:34:42 -0400
commite8fc990aadf438e3b138d77b1bb4500cc60a7738 (patch)
tree641a8b9e92c3a986d38a42068cc092af6b72a736 /libpod
parentc2beea695857b71250c87eb9ab799f7773b8d251 (diff)
parent1199733754b1185d0d2a7a3d832c57565864d0f4 (diff)
downloadpodman-e8fc990aadf438e3b138d77b1bb4500cc60a7738.tar.gz
podman-e8fc990aadf438e3b138d77b1bb4500cc60a7738.tar.bz2
podman-e8fc990aadf438e3b138d77b1bb4500cc60a7738.zip
Merge pull request #11654 from Luap99/health-docker
podman inspect add State.Health field for docker compat
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_inspect.go2
-rw-r--r--libpod/define/container_inspect.go8
2 files changed, 8 insertions, 2 deletions
diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go
index 09e59bf53..ab79d82d9 100644
--- a/libpod/container_inspect.go
+++ b/libpod/container_inspect.go
@@ -156,7 +156,7 @@ func (c *Container) getContainerInspectData(size bool, driverData *define.Driver
// An error here is not considered fatal; no health state will be displayed
logrus.Error(err)
} else {
- data.State.Healthcheck = healthCheckState
+ data.State.Health = healthCheckState
}
}
diff --git a/libpod/define/container_inspect.go b/libpod/define/container_inspect.go
index 90703a807..7decb18a8 100644
--- a/libpod/define/container_inspect.go
+++ b/libpod/define/container_inspect.go
@@ -202,10 +202,16 @@ type InspectContainerState struct {
Error string `json:"Error"` // TODO
StartedAt time.Time `json:"StartedAt"`
FinishedAt time.Time `json:"FinishedAt"`
- Healthcheck HealthCheckResults `json:"Healthcheck,omitempty"`
+ Health HealthCheckResults `json:"Health,omitempty"`
Checkpointed bool `json:"Checkpointed,omitempty"`
}
+// Healthcheck returns the HealthCheckResults. This is used for old podman compat
+// to make the "Healthcheck" key available in the go template.
+func (s *InspectContainerState) Healthcheck() HealthCheckResults {
+ return s.Health
+}
+
// HealthCheckResults describes the results/logs from a healthcheck
type HealthCheckResults struct {
// Status healthy or unhealthy