From 1cd484e13ff4c4b137e1f63c3b9aec0f5e4ef504 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 27 Apr 2020 11:22:27 +0200 Subject: specgen: read healthchecks from the image if there is no healthcheck configuration specified, read it from the image. Signed-off-by: Giuseppe Scrivano --- pkg/specgen/generate/container.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pkg/specgen') diff --git a/pkg/specgen/generate/container.go b/pkg/specgen/generate/container.go index 9797ad572..669b1f05f 100644 --- a/pkg/specgen/generate/container.go +++ b/pkg/specgen/generate/container.go @@ -25,6 +25,13 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat return err } + if s.HealthConfig == nil { + s.HealthConfig, err = newImage.GetHealthCheck(ctx) + if err != nil { + return err + } + } + // Image stop signal if s.StopSignal == nil { stopSignal, err := newImage.StopSignal(ctx) -- cgit v1.2.3-54-g00ecf