From bd46f3236cd92789522435eb2f73152f2b591502 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Wed, 6 Mar 2019 10:16:13 -0800 Subject: [PATCH] update go-containerregistry again --- .../pkg/v1/remote/write.go | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/vendor/github.com/google/go-containerregistry/pkg/v1/remote/write.go b/vendor/github.com/google/go-containerregistry/pkg/v1/remote/write.go index 6a40f79380..0f6b0f68fa 100644 --- a/vendor/github.com/google/go-containerregistry/pkg/v1/remote/write.go +++ b/vendor/github.com/google/go-containerregistry/pkg/v1/remote/write.go @@ -41,18 +41,14 @@ type manifest interface { // Write pushes the provided img to the specified image reference. func Write(ref name.Reference, img v1.Image, auth authn.Authenticator, t http.RoundTripper) error { - fmt.Println("writing image now") ls, err := img.Layers() if err != nil { - fmt.Println("Error with layers") return err } scopes := scopesForUploadingImage(ref, ls) tr, err := transport.New(ref.Context().Registry, auth, t, scopes) if err != nil { - fmt.Println("Error with transport") - return err } w := writer{ @@ -65,7 +61,6 @@ func Write(ref name.Reference, img v1.Image, auth authn.Authenticator, t http.Ro for _, l := range ls { l := l g.Go(func() error { - fmt.Println("uploading one initial") return w.uploadOne(l) }) } @@ -74,18 +69,15 @@ func Write(ref name.Reference, img v1.Image, auth authn.Authenticator, t http.Ro // We can't read the ConfigLayer, because of streaming layers, since the // config hasn't been calculated yet. if err := g.Wait(); err != nil { - fmt.Println("Error with waiting") return err } // Now that all the layers are uploaded, upload the config file blob. l, err := partial.ConfigLayer(img) if err != nil { - fmt.Println("Error with config layer") return err } if err := w.uploadOne(l); err != nil { - fmt.Println("Error with upload one") return err } } else if err != nil { @@ -94,22 +86,17 @@ func Write(ref name.Reference, img v1.Image, auth authn.Authenticator, t http.Ro } else { // We *can* read the ConfigLayer, so upload it concurrently with the layers. g.Go(func() error { - fmt.Println("return uplaod one") - return w.uploadOne(l) }) // Wait for the layers + config. if err := g.Wait(); err != nil { - fmt.Println("Error with waiting again") return err } } // With all of the constituent elements uploaded, upload the manifest // to commit the image. - fmt.Println("Error with committing image?") - return w.commitImage(img) } @@ -283,7 +270,6 @@ func (w *writer) commitBlob(location, digest string) error { // uploadOne performs a complete upload of a single layer. func (w *writer) uploadOne(l v1.Layer) error { - fmt.Println("trying to uplaod one") var from, mount, digest string if _, ok := l.(*stream.Layer); !ok { // Layer isn't streamable, we should take advantage of that to @@ -316,12 +302,10 @@ func (w *writer) uploadOne(l v1.Layer) error { location, mounted, err := w.initiateUpload(from, mount) if err != nil { - fmt.Println("err initiating upload") return err } else if mounted { h, err := l.Digest() if err != nil { - fmt.Println("err getting digest") return err } log.Printf("mounted blob: %s", h.String()) @@ -330,24 +314,20 @@ func (w *writer) uploadOne(l v1.Layer) error { blob, err := l.Compressed() if err != nil { - fmt.Println("Err getting compressed") return err } location, err = w.streamBlob(blob, location) if err != nil { - fmt.Println("err streaming") return err } h, err := l.Digest() if err != nil { - fmt.Println("err digest again") return err } digest = h.String() if err := w.commitBlob(location, digest); err != nil { - fmt.Println("err commit blob again") return err } log.Printf("pushed blob: %s", digest)