diff options
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/github.com/containers/image/v5/copy/copy.go | 5 | ||||
-rw-r--r-- | vendor/github.com/containers/image/v5/copy/progress_bars.go | 15 | ||||
-rw-r--r-- | vendor/modules.txt | 6 |
3 files changed, 17 insertions, 9 deletions
diff --git a/vendor/github.com/containers/image/v5/copy/copy.go b/vendor/github.com/containers/image/v5/copy/copy.go index a318d3f82..ba5334e59 100644 --- a/vendor/github.com/containers/image/v5/copy/copy.go +++ b/vendor/github.com/containers/image/v5/copy/copy.go @@ -237,7 +237,7 @@ func Image(ctx context.Context, policyContext *signature.PolicyContext, destRef, // If reportWriter is not a TTY (e.g., when piping to a file), do not // print the progress bars to avoid long and hard to parse output. - // createProgressBar() will print a single line instead. + // Instead use printCopyInfo() to print single line "Copying ..." messages. progressOutput := reportWriter if !isTTY(reportWriter) { progressOutput = io.Discard @@ -1107,6 +1107,7 @@ func (ic *imageCopier) copyConfig(ctx context.Context, src types.Image) error { defer progressPool.Wait() bar := ic.c.createProgressBar(progressPool, false, srcInfo, "config", "done") defer bar.Abort(false) + ic.c.printCopyInfo("config", srcInfo) configBlob, err := src.ConfigBlob(ctx) if err != nil { @@ -1162,6 +1163,8 @@ func (ic *imageCopier) copyLayer(ctx context.Context, srcInfo types.BlobInfo, to } } + ic.c.printCopyInfo("blob", srcInfo) + cachedDiffID := ic.c.blobInfoCache.UncompressedDigest(srcInfo.Digest) // May be "" diffIDIsNeeded := ic.diffIDsAreNeeded && cachedDiffID == "" // When encrypting to decrypting, only use the simple code path. We might be able to optimize more diff --git a/vendor/github.com/containers/image/v5/copy/progress_bars.go b/vendor/github.com/containers/image/v5/copy/progress_bars.go index 585d86057..85676f01c 100644 --- a/vendor/github.com/containers/image/v5/copy/progress_bars.go +++ b/vendor/github.com/containers/image/v5/copy/progress_bars.go @@ -38,7 +38,8 @@ type progressBar struct { } // createProgressBar creates a progressBar in pool. Note that if the copier's reportWriter -// is io.Discard, the progress bar's output will be discarded +// is io.Discard, the progress bar's output will be discarded. Callers may call printCopyInfo() +// to print a single line instead. // // NOTE: Every progress bar created within a progress pool must either successfully // complete or be aborted, or pool.Wait() will hang. That is typically done @@ -95,15 +96,21 @@ func (c *copier) createProgressBar(pool *mpb.Progress, partial bool, info types. ), ) } - if c.progressOutput == io.Discard { - c.Printf("Copying %s %s\n", kind, info.Digest) - } return &progressBar{ Bar: bar, originalSize: info.Size, } } +// printCopyInfo prints a "Copying ..." message on the copier if the output is +// set to `io.Discard`. In that case, the progress bars won't be rendered but +// we still want to indicate when blobs and configs are copied. +func (c *copier) printCopyInfo(kind string, info types.BlobInfo) { + if c.progressOutput == io.Discard { + c.Printf("Copying %s %s\n", kind, info.Digest) + } +} + // mark100PercentComplete marks the progres bars as 100% complete; // it may do so by possibly advancing the current state if it is below the known total. func (bar *progressBar) mark100PercentComplete() { diff --git a/vendor/modules.txt b/vendor/modules.txt index f4a8192bc..d7edfabe7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -167,7 +167,7 @@ github.com/containers/common/version # github.com/containers/conmon v2.0.20+incompatible ## explicit github.com/containers/conmon/runner/config -# github.com/containers/image/v5 v5.21.2-0.20220714132403-2bb3f3e44c5c +# github.com/containers/image/v5 v5.21.2-0.20220721072459-bf19265865b7 ## explicit github.com/containers/image/v5/copy github.com/containers/image/v5/directory @@ -325,7 +325,6 @@ github.com/coreos/stream-metadata-go/stream/rhcos ## explicit github.com/cyphar/filepath-securejoin # github.com/davecgh/go-spew v1.1.1 -## explicit github.com/davecgh/go-spew/spew # github.com/digitalocean/go-libvirt v0.0.0-20201209184759-e2a69bcd5bd1 github.com/digitalocean/go-libvirt @@ -625,7 +624,6 @@ github.com/ostreedev/ostree-go/pkg/otbuiltin # github.com/pkg/errors v0.9.1 github.com/pkg/errors # github.com/pmezard/go-difflib v1.0.0 -## explicit github.com/pmezard/go-difflib/difflib # github.com/proglottis/gpgme v0.1.3 github.com/proglottis/gpgme @@ -689,7 +687,7 @@ github.com/sylabs/sif/v2/pkg/sif github.com/syndtr/gocapability/capability # github.com/tchap/go-patricia v2.3.0+incompatible github.com/tchap/go-patricia/patricia -# github.com/theupdateframework/go-tuf v0.3.0 +# github.com/theupdateframework/go-tuf v0.3.1 github.com/theupdateframework/go-tuf/encrypted # github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 github.com/titanous/rocacheck |