Add image push to dist tool

Implements image push with progress tracking.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan
2017-05-24 14:10:39 -07:00
parent 26183b3a69
commit 73c8847b47
4 changed files with 299 additions and 2 deletions

4
cmd/dist/fetch.go vendored
View File

@@ -231,14 +231,14 @@ func display(w io.Writer, statuses []statusInfo, start time.Time) {
for _, status := range statuses {
total += status.Offset
switch status.Status {
case "downloading":
case "downloading", "uploading":
bar := progress.Bar(float64(status.Offset) / float64(status.Total))
fmt.Fprintf(w, "%s:\t%s\t%40r\t%8.8s/%s\t\n",
status.Ref,
status.Status,
bar,
progress.Bytes(status.Offset), progress.Bytes(status.Total))
case "resolving":
case "resolving", "waiting":
bar := progress.Bar(0.0)
fmt.Fprintf(w, "%s:\t%s\t%40r\t\n",
status.Ref,