mirror of
https://github.com/containers/podman.git
synced 2025-12-01 18:49:18 +08:00
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:
20
vendor/github.com/containers/common/libimage/pull.go
generated
vendored
20
vendor/github.com/containers/common/libimage/pull.go
generated
vendored
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user