1
0
mirror of https://github.com/containers/buildah.git synced 2025-07-30 04:23:09 +03:00

push: show image digest after push succeed

After change :

```
➜  buildah git:(push-fix) ✗ sudo ./buildah push 71c dir:/home/zhouhao/test/buildah
Getting image source signatures
Copying blob sha256:cdb3f9544e4c61d45da1ea44f7d92386639a052c620d1550376f22f5b46981af
 55.73 MiB / 55.73 MiB [====================================================] 1s
Copying blob sha256:7f2cffb520ed710c0871cd07f4fd8041d67fb9b4a74e03d036db55c23a085840
 51.81 MiB / 51.81 MiB [====================================================] 0s
Copying blob sha256:64ef7c2d456f323178e92fd11fd6819c4b913ffedf3d27f8bf12702e6f953d36
 3.50 KiB / 3.50 KiB [======================================================] 0s
Copying config sha256:71c43202b8ac897ff4d048d3b37bdf4eb543ec5c03fd017c3e12c616c6792206
 5.88 KiB / 5.88 KiB [======================================================] 0s
Writing manifest to image destination
Storing signatures
Succefully pushed /home/zhouhao/test/buildah@d963acde7543161ad481fa33d4d03dcbd826826385c8155a5d6b3c89cb297fbb
```

Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>

Closes: #992
Approved by: rhatdan
This commit is contained in:
Zhou Hao
2018-09-07 16:56:24 +08:00
committed by Atomic Bot
parent 80b4a5d10a
commit 8ff6c26495

View File

@ -171,7 +171,7 @@ func Push(ctx context.Context, image string, dest types.ImageReference, options
return errors.Wrapf(err, "error creating new signature policy context")
}
// Look up the image.
src, _, err := util.FindImage(options.Store, "", systemContext, image)
src, img, err := util.FindImage(options.Store, "", systemContext, image)
if err != nil {
return err
}
@ -181,7 +181,9 @@ func Push(ctx context.Context, image string, dest types.ImageReference, options
return errors.Wrapf(err, "error copying layers and metadata")
}
if options.ReportWriter != nil {
fmt.Fprintf(options.ReportWriter, "\n")
fmt.Fprintf(options.ReportWriter, "")
}
digest := "@" + img.Digest.Hex()
fmt.Printf("Successfully pushed %s%s\n", dest.StringWithinTransport(), digest)
return nil
}