Merge pull request #579 from runcom/v0134

release v0.1.34
This commit is contained in:
Antonio Murdaca
2018-12-21 16:10:05 +01:00
committed by GitHub
6 changed files with 10 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
github.com/urfave/cli v1.20.0
github.com/kr/pretty v0.1.0
github.com/kr/text v0.1.0
github.com/containers/image 50e5e55e46a391df8fce1291b2337f1af879b822
github.com/containers/image f0cbc16b444d729362c78244c715b45bf4019b71
golang.org/x/sync 42b317875d0fa942474b76e1b46a6060d720ae6e
github.com/opencontainers/go-digest c9281466c8b2f606084ac71339773efd177436e7
gopkg.in/cheggaaa/pb.v1 v1.0.27

View File

@@ -395,12 +395,13 @@ func shortDigest(d digest.Digest) string {
}
// createProgressBar creates a pb.ProgressBar.
func createProgressBar(srcInfo types.BlobInfo, kind string) *pb.ProgressBar {
func createProgressBar(srcInfo types.BlobInfo, kind string, writer io.Writer) *pb.ProgressBar {
bar := pb.New(int(srcInfo.Size)).SetUnits(pb.U_BYTES)
bar.SetMaxWidth(80)
bar.ShowTimeLeft = false
bar.ShowPercent = false
bar.Prefix(fmt.Sprintf("Copying %s %s:", kind, shortDigest(srcInfo.Digest)))
bar.Output = writer
return bar
}
@@ -468,11 +469,12 @@ func (ic *imageCopier) copyLayers(ctx context.Context) error {
progressBars := make([]*pb.ProgressBar, numLayers)
for i, srcInfo := range srcInfos {
bar := createProgressBar(srcInfo, "blob")
bar := createProgressBar(srcInfo, "blob", nil)
progressBars[i] = bar
}
progressPool := pb.NewPool(progressBars...)
progressPool.Output = ic.c.reportWriter
if err := progressPool.Start(); err != nil {
return errors.Wrapf(err, "error creating progress-bar pool")
}
@@ -566,7 +568,7 @@ func (c *copier) copyConfig(ctx context.Context, src types.Image) error {
if err != nil {
return errors.Wrapf(err, "Error reading config blob %s", srcInfo.Digest)
}
bar := createProgressBar(srcInfo, "config")
bar := createProgressBar(srcInfo, "config", c.reportWriter)
defer bar.Finish()
bar.Start()
destInfo, err := c.copyBlobFromStream(ctx, bytes.NewReader(configBlob), srcInfo, nil, false, true, bar)

View File

@@ -113,7 +113,7 @@ func (c *sizeCounter) Write(p []byte) (n int, err error) {
// HasThreadSafePutBlob indicates whether PutBlob can be executed concurrently.
func (d *dockerImageDestination) HasThreadSafePutBlob() bool {
return true
return false
}
// PutBlob writes contents of stream and returns data representing the result (with all data filled in).

View File

@@ -331,7 +331,7 @@ func (s *storageImageDestination) computeNextBlobCacheFile() string {
}
// HasThreadSafePutBlob indicates whether PutBlob can be executed concurrently.
func (d *storageImageDestination) HasThreadSafePutBlob() bool {
func (s *storageImageDestination) HasThreadSafePutBlob() bool {
return true
}

View File

@@ -207,7 +207,7 @@ func (is *tarballImageSource) Close() error {
}
// HasThreadSafeGetBlob indicates whether GetBlob can be executed concurrently.
func (s *tarballImageSource) HasThreadSafeGetBlob() bool {
func (is *tarballImageSource) HasThreadSafeGetBlob() bool {
return false
}

View File

@@ -1,4 +1,4 @@
package version
// Version is the version of the build.
const Version = "0.1.34-dev"
const Version = "0.1.35-dev"