mirror of
https://github.com/containers/skopeo.git
synced 2025-08-07 09:33:58 +00:00
Always close the blob we are reading from a registry
== the HTTP response body. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
603d37c588
commit
a0799484c8
@ -151,10 +151,12 @@ func (opts *layersOptions) run(args []string, stdout io.Writer) (retErr error) {
|
|||||||
}, opts.retryOpts); err != nil {
|
}, opts.retryOpts); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := dest.PutBlob(ctx, r, types.BlobInfo{Digest: bd.digest, Size: blobSize}, cache, bd.isConfig); err != nil {
|
defer func() {
|
||||||
if closeErr := r.Close(); closeErr != nil {
|
if err := r.Close(); err != nil {
|
||||||
return fmt.Errorf("%w (close error: %v)", err, closeErr)
|
retErr = noteCloseFailure(retErr, fmt.Sprintf("closing blob %q", bd.digest.String()), err)
|
||||||
}
|
}
|
||||||
|
}()
|
||||||
|
if _, err := dest.PutBlob(ctx, r, types.BlobInfo{Digest: bd.digest, Size: blobSize}, cache, bd.isConfig); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user