mirror of
https://github.com/containers/podman.git
synced 2025-06-11 10:25:41 +08:00
update c/common
Update containers common to the latest HEAD. Some bug fixes in libimage forced us to have a clearer separation between ordinary images and manifest lists. Hence, when looking up manifest lists without recursing into any of their instances, we need to use `LookupManifestList()`. Also account for some other changes in c/common (e.g., the changed order in the security labels). Further vendor the latest HEAD from Buildah which is required to get the bud tests to pass. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
22
vendor/github.com/containers/buildah/commit.go
generated
vendored
22
vendor/github.com/containers/buildah/commit.go
generated
vendored
@ -11,6 +11,7 @@ import (
|
||||
|
||||
"github.com/containers/buildah/pkg/blobcache"
|
||||
"github.com/containers/buildah/util"
|
||||
"github.com/containers/common/libimage"
|
||||
"github.com/containers/common/libimage/manifests"
|
||||
"github.com/containers/image/v5/docker"
|
||||
"github.com/containers/image/v5/docker/reference"
|
||||
@ -18,7 +19,6 @@ import (
|
||||
"github.com/containers/image/v5/signature"
|
||||
is "github.com/containers/image/v5/storage"
|
||||
"github.com/containers/image/v5/transports"
|
||||
"github.com/containers/image/v5/transports/alltransports"
|
||||
"github.com/containers/image/v5/types"
|
||||
encconfig "github.com/containers/ocicrypt/config"
|
||||
"github.com/containers/storage"
|
||||
@ -174,12 +174,16 @@ func (b *Builder) addManifest(ctx context.Context, manifestName string, imageSpe
|
||||
var create bool
|
||||
systemContext := &types.SystemContext{}
|
||||
var list manifests.List
|
||||
_, listImage, err := util.FindImage(b.store, "", systemContext, manifestName)
|
||||
runtime, err := libimage.RuntimeFromStore(b.store, &libimage.RuntimeOptions{SystemContext: systemContext})
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
manifestList, err := runtime.LookupManifestList(manifestName)
|
||||
if err != nil {
|
||||
create = true
|
||||
list = manifests.Create()
|
||||
} else {
|
||||
_, list, err = manifests.LoadFromImage(b.store, listImage.ID)
|
||||
_, list, err = manifests.LoadFromImage(b.store, manifestList.ID())
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@ -190,13 +194,11 @@ func (b *Builder) addManifest(ctx context.Context, manifestName string, imageSpe
|
||||
return "", errors.Wrapf(err, "error encountered while expanding image name %q", manifestName)
|
||||
}
|
||||
|
||||
ref, err := alltransports.ParseImageName(imageSpec)
|
||||
ref, err := util.VerifyTagName(imageSpec)
|
||||
if err != nil {
|
||||
if ref, err = alltransports.ParseImageName(util.DefaultTransport + imageSpec); err != nil {
|
||||
// check if the local image exists
|
||||
if ref, _, err = util.FindImage(b.store, "", systemContext, imageSpec); err != nil {
|
||||
return "", err
|
||||
}
|
||||
// check if the local image exists
|
||||
if ref, _, err = util.FindImage(b.store, "", systemContext, imageSpec); err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
@ -207,7 +209,7 @@ func (b *Builder) addManifest(ctx context.Context, manifestName string, imageSpe
|
||||
if create {
|
||||
imageID, err = list.SaveToImage(b.store, "", names, manifest.DockerV2ListMediaType)
|
||||
} else {
|
||||
imageID, err = list.SaveToImage(b.store, listImage.ID, nil, "")
|
||||
imageID, err = list.SaveToImage(b.store, manifestList.ID(), nil, "")
|
||||
}
|
||||
return imageID, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user