Merge pull request #6024 from baude/v2checkmediatypew

check image media/manifest type for healthchecks
This commit is contained in:
OpenShift Merge Robot 2020-04-28 19:21:50 +02:00 committed by GitHub
commit 23be7b5049
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -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