mirror of
https://github.com/containers/skopeo.git
synced 2025-05-31 02:35:19 +00:00
fix containers/image progress
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
5b7fcc8eca
commit
0420fa0299
13
vendor/github.com/containers/image/copy/copy.go
generated
vendored
13
vendor/github.com/containers/image/copy/copy.go
generated
vendored
@ -91,11 +91,12 @@ type Options struct {
|
|||||||
|
|
||||||
// Image copies image from srcRef to destRef, using policyContext to validate source image admissibility.
|
// Image copies image from srcRef to destRef, using policyContext to validate source image admissibility.
|
||||||
func Image(ctx *types.SystemContext, policyContext *signature.PolicyContext, destRef, srcRef types.ImageReference, options *Options) error {
|
func Image(ctx *types.SystemContext, policyContext *signature.PolicyContext, destRef, srcRef types.ImageReference, options *Options) error {
|
||||||
if options.ReportWriter == nil {
|
reportWriter := options.ReportWriter
|
||||||
options.ReportWriter = ioutil.Discard
|
if reportWriter == nil {
|
||||||
|
reportWriter = ioutil.Discard
|
||||||
}
|
}
|
||||||
writeReport := func(f string, a ...interface{}) {
|
writeReport := func(f string, a ...interface{}) {
|
||||||
fmt.Fprintf(options.ReportWriter, f, a...)
|
fmt.Fprintf(reportWriter, f, a...)
|
||||||
}
|
}
|
||||||
dest, err := destRef.NewImageDestination(ctx)
|
dest, err := destRef.NewImageDestination(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -270,11 +271,7 @@ func copyBlob(dest types.ImageDestination, src types.ImageSource, srcInfo types.
|
|||||||
bar.Start()
|
bar.Start()
|
||||||
destStream = bar.NewProxyReader(destStream)
|
destStream = bar.NewProxyReader(destStream)
|
||||||
|
|
||||||
defer func() {
|
defer fmt.Fprint(reportWriter, "\n")
|
||||||
if err != nil {
|
|
||||||
fmt.Fprint(reportWriter, "\n")
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
var inputInfo types.BlobInfo
|
var inputInfo types.BlobInfo
|
||||||
if !canCompress || isCompressed || !dest.ShouldCompressLayers() {
|
if !canCompress || isCompressed || !dest.ShouldCompressLayers() {
|
||||||
|
Loading…
Reference in New Issue
Block a user