summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-04-27 11:22:27 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-04-27 11:22:27 +0200
commit1cd484e13ff4c4b137e1f63c3b9aec0f5e4ef504 (patch)
treef11242cbbd7038a4142e491a146a164515bac455 /pkg/specgen/generate
parent350727570b6f033c5c509a62ec8bfc4827e1c2fc (diff)
downloadpodman-1cd484e13ff4c4b137e1f63c3b9aec0f5e4ef504.tar.gz
podman-1cd484e13ff4c4b137e1f63c3b9aec0f5e4ef504.tar.bz2
podman-1cd484e13ff4c4b137e1f63c3b9aec0f5e4ef504.zip
specgen: read healthchecks from the image
if there is no healthcheck configuration specified, read it from the image. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/specgen/generate')
-rw-r--r--pkg/specgen/generate/container.go7
1 files changed, 7 insertions, 0 deletions
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)