summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-28 19:21:50 +0200
committerGitHub <noreply@github.com>2020-04-28 19:21:50 +0200
commit23be7b50490ac01c31af3266490276dd46ec23c3 (patch)
tree9fba0b17ca3c71d9ebe58ddce7f6ca35aac01189 /pkg
parent8f57f312d6c22b0c7c25f415872177f2ef9a0c7e (diff)
parenta255075fe8825844f484981c77bb5e59b202a1e9 (diff)
downloadpodman-23be7b50490ac01c31af3266490276dd46ec23c3.tar.gz
podman-23be7b50490ac01c31af3266490276dd46ec23c3.tar.bz2
podman-23be7b50490ac01c31af3266490276dd46ec23c3.zip
Merge pull request #6024 from baude/v2checkmediatypew
check image media/manifest type for healthchecks
Diffstat (limited to 'pkg')
-rw-r--r--pkg/specgen/generate/container.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/specgen/generate/container.go b/pkg/specgen/generate/container.go
index 75e8d8191..92a2b4d35 100644
--- a/pkg/specgen/generate/container.go
+++ b/pkg/specgen/generate/container.go
@@ -3,6 +3,7 @@ package generate
import (
"context"
+ "github.com/containers/image/v5/manifest"
"github.com/containers/libpod/libpod"
ann "github.com/containers/libpod/pkg/annotations"
envLib "github.com/containers/libpod/pkg/env"
@@ -22,7 +23,12 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
return err
}
- if s.HealthConfig == nil {
+ _, mediaType, err := newImage.Manifest(ctx)
+ if err != nil {
+ return err
+ }
+
+ if s.HealthConfig == nil && mediaType == manifest.DockerV2Schema2MediaType {
s.HealthConfig, err = newImage.GetHealthCheck(ctx)
if err != nil {
return err