mirror of
https://github.com/containers/podman.git
synced 2025-09-28 01:04:28 +08:00
Vendor in containers/buildah v1.19.3
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
21
vendor/github.com/containers/buildah/util/util.go
generated
vendored
21
vendor/github.com/containers/buildah/util/util.go
generated
vendored
@ -20,6 +20,7 @@ import (
|
||||
"github.com/containers/image/v5/types"
|
||||
"github.com/containers/storage"
|
||||
"github.com/docker/distribution/registry/api/errcode"
|
||||
"github.com/opencontainers/go-digest"
|
||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
@ -68,6 +69,19 @@ func ResolveName(name string, firstRegistry string, sc *types.SystemContext, sto
|
||||
return []string{img.ID}, "", false, nil
|
||||
}
|
||||
}
|
||||
// If we're referring to an image by digest, it *must* be local and we
|
||||
// should not have any fall through/back logic.
|
||||
if strings.HasPrefix(name, "sha256:") {
|
||||
d, err := digest.Parse(name)
|
||||
if err != nil {
|
||||
return nil, "", false, err
|
||||
}
|
||||
img, err := store.Image(d.Encoded())
|
||||
if err != nil {
|
||||
return nil, "", false, err
|
||||
}
|
||||
return []string{img.ID}, "", false, nil
|
||||
}
|
||||
|
||||
// Transports are not supported for local image look ups.
|
||||
srcRef, err := alltransports.ParseImageName(name)
|
||||
@ -263,7 +277,12 @@ func Runtime() string {
|
||||
return "crun"
|
||||
}
|
||||
|
||||
return DefaultRuntime
|
||||
conf, err := config.Default()
|
||||
if err != nil {
|
||||
logrus.Warnf("Error loading container config when searching for local runtime: %v", err)
|
||||
return DefaultRuntime
|
||||
}
|
||||
return conf.Engine.OCIRuntime
|
||||
}
|
||||
|
||||
// StringInSlice returns a boolean indicating if the exact value s is present
|
||||
|
Reference in New Issue
Block a user