From 810e1342b9c792091c2232f464843f9d60b9365f Mon Sep 17 00:00:00 2001 From: Alex Suraci Date: Sun, 30 Sep 2018 14:52:57 -0400 Subject: [PATCH] out: print response --- cmd/out/main.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/cmd/out/main.go b/cmd/out/main.go index a74ddc4..f8fd112 100644 --- a/cmd/out/main.go +++ b/cmd/out/main.go @@ -97,13 +97,20 @@ func main() { Image: img, } + digest, err := img.Digest() + if err != nil { + logrus.Errorf("failed to get image digest: %s", err) + os.Exit(1) + return + } + + logrus.Infof("pushing %s to %s", digest, ref) + auth := &authn.Basic{ Username: req.Source.Username, Password: req.Source.Password, } - logrus.Infof("pushing to %s", ref) - err = remote.Write(n, img, auth, http.DefaultTransport, remote.WriteOptions{}) if err != nil { logrus.Errorf("failed to upload image: %s", err) @@ -112,4 +119,11 @@ func main() { } logrus.Info("pushed") + + json.NewEncoder(os.Stdout).Encode(OutResponse{ + Version: resource.Version{ + Digest: digest.String(), + }, + Metadata: []resource.MetadataField{}, + }) }