From 6181faa90de3a166004cca4fb6a8d85c17cbfe53 Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Sun, 26 Jan 2020 16:00:32 -0600 Subject: 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 --- libpod/image/image.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libpod') 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 } -- cgit v1.2.3-54-g00ecf