diff options
author | Brent Baude <bbaude@redhat.com> | 2020-01-26 16:00:32 -0600 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-01-27 08:36:25 -0600 |
commit | 6181faa90de3a166004cca4fb6a8d85c17cbfe53 (patch) | |
tree | a47af8dbcfc1f01141b1d1ebc72d1cf88dabeea0 /libpod/image/image.go | |
parent | 40d36b1cf11be8f6e102a4bf28144d33082b453a (diff) | |
download | podman-6181faa90de3a166004cca4fb6a8d85c17cbfe53.tar.gz podman-6181faa90de3a166004cca4fb6a8d85c17cbfe53.tar.bz2 podman-6181faa90de3a166004cca4fb6a8d85c17cbfe53.zip |
inspect image healthchecks
when a docker image has a defined healthcheck, it should be displayed with inspect. this is only valid for docker images as oci images are not aware of healthchecks.
Fixes: #4799
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'libpod/image/image.go')
-rw-r--r-- | libpod/image/image.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go index 6ea49e2a9..7ee8c45d7 100644 --- a/libpod/image/image.go +++ b/libpod/image/image.go @@ -1012,6 +1012,15 @@ func (i *Image) Inspect(ctx context.Context) (*inspect.ImageData, error) { History: ociv1Img.History, NamesHistory: i.NamesHistory(), } + if manifestType == manifest.DockerV2Schema2MediaType { + hc, err := i.GetHealthCheck(ctx) + if err != nil { + return nil, err + } + if hc != nil { + data.HealthCheck = hc + } + } return data, nil } |