mirror of
https://github.com/containers/podman.git
synced 2025-12-02 11:08:36 +08:00
Vendor in latest c/common
Pull in updates made to the filters code for images. Filters now perform an AND operation except for th reference filter which does an OR operation for positive case but an AND operation for negative cases. Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
This commit is contained in:
17
vendor/github.com/containers/common/libimage/runtime.go
generated
vendored
17
vendor/github.com/containers/common/libimage/runtime.go
generated
vendored
@@ -1,5 +1,4 @@
|
||||
//go:build !remote
|
||||
// +build !remote
|
||||
|
||||
package libimage
|
||||
|
||||
@@ -162,7 +161,7 @@ func (r *Runtime) storageToImage(storageImage *storage.Image, ref types.ImageRef
|
||||
}
|
||||
}
|
||||
|
||||
// Exists returns true if the specicifed image exists in the local containers
|
||||
// Exists returns true if the specified image exists in the local containers
|
||||
// storage. Note that it may return false if an image corrupted.
|
||||
func (r *Runtime) Exists(name string) (bool, error) {
|
||||
image, _, err := r.LookupImage(name, nil)
|
||||
@@ -172,7 +171,7 @@ func (r *Runtime) Exists(name string) (bool, error) {
|
||||
if image == nil {
|
||||
return false, nil
|
||||
}
|
||||
if err := image.isCorrupted(name); err != nil {
|
||||
if err := image.isCorrupted(context.Background(), name); err != nil {
|
||||
logrus.Error(err)
|
||||
return false, nil
|
||||
}
|
||||
@@ -235,8 +234,12 @@ func (r *Runtime) LookupImage(name string, options *LookupImageOptions) (*Image,
|
||||
if storageRef.Transport().Name() != storageTransport.Transport.Name() {
|
||||
return nil, "", fmt.Errorf("unsupported transport %q for looking up local images", storageRef.Transport().Name())
|
||||
}
|
||||
img, err := storageTransport.Transport.GetStoreImage(r.store, storageRef)
|
||||
_, img, err := storageTransport.ResolveReference(storageRef)
|
||||
if err != nil {
|
||||
if errors.Is(err, storageTransport.ErrNoSuchImage) {
|
||||
// backward compatibility
|
||||
return nil, "", storage.ErrImageUnknown
|
||||
}
|
||||
return nil, "", err
|
||||
}
|
||||
logrus.Debugf("Found image %q in local containers storage (%s)", name, storageRef.StringWithinTransport())
|
||||
@@ -347,9 +350,9 @@ func (r *Runtime) lookupImageInLocalStorage(name, candidate string, namedCandida
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
img, err = storageTransport.Transport.GetStoreImage(r.store, ref)
|
||||
_, img, err = storageTransport.ResolveReference(ref)
|
||||
if err != nil {
|
||||
if errors.Is(err, storage.ErrImageUnknown) {
|
||||
if errors.Is(err, storageTransport.ErrNoSuchImage) {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, err
|
||||
@@ -605,7 +608,7 @@ func (r *Runtime) ListImages(ctx context.Context, names []string, options *ListI
|
||||
// as the layer tree will computed once for all instead of once for
|
||||
// each individual image (see containers/podman/issues/17828).
|
||||
|
||||
tree, err := r.layerTree(images)
|
||||
tree, err := r.layerTree(ctx, images)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user