summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-01-06 23:36:09 +0100
committerGitHub <noreply@github.com>2022-01-06 23:36:09 +0100
commit3ac1219cbcfe8ccd83ed7b73b92e1d6f13abf550 (patch)
tree4fe890289a727982ddf77569ac1d1db45a8068c8 /pkg
parentd62752819214ee7f910e25d368d427fbcac74b17 (diff)
parent2a524fcaec4e6f66461d7cdda1bb73ed7c50f026 (diff)
downloadpodman-3ac1219cbcfe8ccd83ed7b73b92e1d6f13abf550.tar.gz
podman-3ac1219cbcfe8ccd83ed7b73b92e1d6f13abf550.tar.bz2
podman-3ac1219cbcfe8ccd83ed7b73b92e1d6f13abf550.zip
Merge pull request #12614 from baude/bz2028408
fix healthcheck timeouts and ut8 coercion
Diffstat (limited to 'pkg')
-rw-r--r--pkg/specgen/generate/container.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/specgen/generate/container.go b/pkg/specgen/generate/container.go
index 57676db10..5ec7c7b03 100644
--- a/pkg/specgen/generate/container.go
+++ b/pkg/specgen/generate/container.go
@@ -4,6 +4,7 @@ import (
"context"
"os"
"strings"
+ "time"
"github.com/containers/common/libimage"
"github.com/containers/podman/v3/libpod"
@@ -64,6 +65,13 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
// NOTE: the health check is only set for Docker images
// but inspect will take care of it.
s.HealthConfig = inspectData.HealthCheck
+ if s.HealthConfig != nil && s.HealthConfig.Timeout == 0 {
+ hct, err := time.ParseDuration(define.DefaultHealthCheckTimeout)
+ if err != nil {
+ return nil, err
+ }
+ s.HealthConfig.Timeout = hct
+ }
}
// Image stop signal