vendor: bump buildah, c/image and c/storage

Bumps

c/buildah to -> `v1.24.3-0.20220310160415-5ec70bf01ea5`
c/storage to -> `v1.38.3-0.20220308085612-93ce26691863`
c/image to -> `v5.20.1-0.20220310094651-0d8056ee346f`

Signed-off-by: Aditya R <arajan@redhat.com>
This commit is contained in:
Aditya R
2022-03-13 23:26:59 +05:30
parent 0144cabc41
commit 780d4b2d65
109 changed files with 3729 additions and 1752 deletions

View File

@@ -21,6 +21,24 @@ import (
"github.com/sirupsen/logrus"
)
// cacheLookupReferenceFunc wraps a BlobCache into a
// libimage.LookupReferenceFunc to allow for using a BlobCache during
// image-copy operations.
func cacheLookupReferenceFunc(directory string, compress types.LayerCompression) libimage.LookupReferenceFunc {
// Using a closure here allows us to reference a BlobCache without
// having to explicitly maintain it in the libimage API.
return func(ref types.ImageReference) (types.ImageReference, error) {
if directory == "" {
return ref, nil
}
ref, err := blobcache.NewBlobCache(ref, directory, compress)
if err != nil {
return nil, errors.Wrapf(err, "error using blobcache %q", directory)
}
return ref, nil
}
}
// PushOptions can be used to alter how an image is copied somewhere.
type PushOptions struct {
// Compression specifies the type of compression which is applied to
@@ -99,13 +117,11 @@ func Push(ctx context.Context, image string, dest types.ImageReference, options
libimageOptions.Writer = nil
}
if options.BlobDirectory != "" {
compress := types.PreserveOriginal
if options.Compression == archive.Gzip {
compress = types.Compress
}
libimageOptions.SourceLookupReferenceFunc = blobcache.CacheLookupReferenceFunc(options.BlobDirectory, compress)
compress := types.PreserveOriginal
if options.Compression == archive.Gzip {
compress = types.Compress
}
libimageOptions.SourceLookupReferenceFunc = cacheLookupReferenceFunc(options.BlobDirectory, compress)
runtime, err := libimage.RuntimeFromStore(options.Store, &libimage.RuntimeOptions{SystemContext: options.SystemContext})
if err != nil {