mirror of
https://github.com/containers/podman.git
synced 2025-09-26 16:25:00 +08:00
vendor containers/common@main
Pull in fixes for local image lookups. Fixes: #10835 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
4
vendor/github.com/containers/common/libimage/filters.go
generated
vendored
4
vendor/github.com/containers/common/libimage/filters.go
generated
vendored
@ -63,14 +63,14 @@ func (r *Runtime) compileImageFilters(ctx context.Context, filters []string) ([]
|
||||
switch key {
|
||||
|
||||
case "after", "since":
|
||||
img, _, err := r.LookupImage(value, nil)
|
||||
img, _, err := r.LookupImage(value, &LookupImageOptions{IgnorePlatform: true})
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "could not find local image for filter %q", filter)
|
||||
}
|
||||
filterFuncs = append(filterFuncs, filterAfter(img.Created()))
|
||||
|
||||
case "before":
|
||||
img, _, err := r.LookupImage(value, nil)
|
||||
img, _, err := r.LookupImage(value, &LookupImageOptions{IgnorePlatform: true})
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "could not find local image for filter %q", filter)
|
||||
}
|
||||
|
5
vendor/github.com/containers/common/libimage/pull.go
generated
vendored
5
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, nil)
|
||||
local, _, err := r.LookupImage(name, &LookupImageOptions{IgnorePlatform: true})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -145,9 +145,8 @@ func (r *Runtime) Pull(ctx context.Context, name string, pullPolicy config.PullP
|
||||
}
|
||||
|
||||
localImages := []*Image{}
|
||||
lookupOptions := &LookupImageOptions{IgnorePlatform: true}
|
||||
for _, name := range pulledImages {
|
||||
local, _, err := r.LookupImage(name, lookupOptions)
|
||||
local, _, err := r.LookupImage(name, &LookupImageOptions{IgnorePlatform: true})
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "error locating pulled image %q name in containers storage", name)
|
||||
}
|
||||
|
4
vendor/github.com/containers/common/libimage/save.go
generated
vendored
4
vendor/github.com/containers/common/libimage/save.go
generated
vendored
@ -74,7 +74,7 @@ func (r *Runtime) Save(ctx context.Context, names []string, format, path string,
|
||||
// saveSingleImage saves the specified image name to the specified path.
|
||||
// Supported formats are "oci-archive", "oci-dir" and "docker-dir".
|
||||
func (r *Runtime) saveSingleImage(ctx context.Context, name, format, path string, options *SaveOptions) error {
|
||||
image, imageName, err := r.LookupImage(name, nil)
|
||||
image, imageName, err := r.LookupImage(name, &LookupImageOptions{IgnorePlatform: true})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -155,7 +155,7 @@ func (r *Runtime) saveDockerArchive(ctx context.Context, names []string, path st
|
||||
visitedNames := make(map[string]bool) // filters duplicate names
|
||||
for _, name := range names {
|
||||
// Look up local images.
|
||||
image, imageName, err := r.LookupImage(name, nil)
|
||||
image, imageName, err := r.LookupImage(name, &LookupImageOptions{IgnorePlatform: true})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user