vendor containers/common@main

The `IgnorePlatform` options has been removed from the
`LookupImageOptions` in libimage to properly support multi-arch images.

Skip one buildah-bud test which requires updated CI images.  This is
currently being done in github.com/containers/podman/pull/10829 but
we need to unblock merging common and buildah into podman.

[NO TESTS NEEDED]

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2021-07-02 14:37:30 +02:00
parent f0cd16cb32
commit e1ac0c3033
26 changed files with 303 additions and 146 deletions

View File

@@ -61,7 +61,7 @@ func (r *Runtime) Pull(ctx context.Context, name string, pullPolicy config.PullP
if pullPolicy == config.PullPolicyAlways {
return nil, errors.Errorf("pull policy is always but image has been referred to by ID (%s)", name)
}
local, _, err := r.LookupImage(name, &LookupImageOptions{IgnorePlatform: true})
local, _, err := r.LookupImage(name, nil)
if err != nil {
return nil, err
}
@@ -146,7 +146,7 @@ func (r *Runtime) Pull(ctx context.Context, name string, pullPolicy config.PullP
localImages := []*Image{}
for _, name := range pulledImages {
local, _, err := r.LookupImage(name, &LookupImageOptions{IgnorePlatform: true})
local, _, err := r.LookupImage(name, nil)
if err != nil {
return nil, errors.Wrapf(err, "error locating pulled image %q name in containers storage", name)
}
@@ -362,15 +362,13 @@ func (r *Runtime) copySingleImageFromRegistry(ctx context.Context, imageName str
// resolved name for pulling. Assume we're doing a `pull foo`.
// If there's already a local image "localhost/foo", then we should
// attempt pulling that instead of doing the full short-name dance.
lookupOptions := &LookupImageOptions{
// NOTE: we must ignore the platform of a local image when
// doing lookups. Some images set an incorrect or even invalid
// platform (see containers/podman/issues/10682). Doing the
// lookup while ignoring the platform checks prevents
// redundantly downloading the same image.
IgnorePlatform: true,
}
localImage, resolvedImageName, err = r.LookupImage(imageName, lookupOptions)
//
// NOTE: we must ignore the platform of a local image when doing
// lookups here, even if arch/os/variant is set. Some images set an
// incorrect or even invalid platform (see containers/podman/issues/10682).
// Doing the lookup while ignoring the platform checks prevents
// redundantly downloading the same image.
localImage, resolvedImageName, err = r.LookupImage(imageName, nil)
if err != nil && errors.Cause(err) != storage.ErrImageUnknown {
logrus.Errorf("Looking up %s in local storage: %v", imageName, err)
}