diff options
author | Paul Holzinger <pholzing@redhat.com> | 2021-09-20 13:19:50 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2021-09-23 14:44:34 +0200 |
commit | 1199733754b1185d0d2a7a3d832c57565864d0f4 (patch) | |
tree | 20f7a33df89744836959f308e2faa8fa07f6ef95 /pkg/api/handlers/compat/containers.go | |
parent | aa628b82b1c2f04fb3a9a9207bb6d6bddb497fbb (diff) | |
download | podman-1199733754b1185d0d2a7a3d832c57565864d0f4.tar.gz podman-1199733754b1185d0d2a7a3d832c57565864d0f4.tar.bz2 podman-1199733754b1185d0d2a7a3d832c57565864d0f4.zip |
podman inspect add State.Health field for docker compat
podman inspect shows the healthcheck status in `.State.Healthcheck`,
docker uses `.State.Health`. To make sure docker scripts work we
should add the `Health` key. Because we do not want to display both keys
by default we only use the new `Health` key. This is a breaking change
for podman users but matches what docker does. To provide some form of
compatibility users can still use `--format {{.State.Healthcheck}}`. IT
is just not shown by default.
Fixes #11645
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'pkg/api/handlers/compat/containers.go')
-rw-r--r-- | pkg/api/handlers/compat/containers.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go index a15fdb553..18005e24a 100644 --- a/pkg/api/handlers/compat/containers.go +++ b/pkg/api/handlers/compat/containers.go @@ -410,11 +410,11 @@ func LibpodToContainerJSON(l *libpod.Container, sz bool) (*types.ContainerJSON, if l.HasHealthCheck() && state.Status != "created" { state.Health = &types.Health{ - Status: inspect.State.Healthcheck.Status, - FailingStreak: inspect.State.Healthcheck.FailingStreak, + Status: inspect.State.Health.Status, + FailingStreak: inspect.State.Health.FailingStreak, } - log := inspect.State.Healthcheck.Log + log := inspect.State.Health.Log for _, item := range log { res := &types.HealthcheckResult{} |