Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions pkg/compose/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/distribution/reference"
"github.com/docker/cli/cli/config/configfile"
clitypes "github.com/docker/cli/cli/config/types"
"github.com/docker/go-units"
"github.com/moby/moby/api/types/jsonstream"
"github.com/moby/moby/client"
"github.com/opencontainers/go-digest"
Expand Down Expand Up @@ -414,16 +415,13 @@ func toPullProgressEvent(parent string, jm jsonstream.Message, events api.EventP
}

var (
progress string
total int64
percent int
current int64
status = api.Working
details string
total int64
percent int
current int64
status = api.Working
)

// FIXME(thaJeztah): what's the replacement for Progress.String()?
// progress = jm.Progress.String()

switch jm.Status {
case PreparingPhase, WaitingPhase, PullingFsPhase:
percent = 0
Expand Down Expand Up @@ -451,7 +449,9 @@ func toPullProgressEvent(parent string, jm jsonstream.Message, events api.EventP

if jm.Error != nil {
status = api.Error
progress = jm.Error.Message
details = jm.Error.Message
} else {
details = units.HumanSize(float64(jm.Progress.Current))
}

events.On(api.Resource{
Expand All @@ -462,6 +462,6 @@ func toPullProgressEvent(parent string, jm jsonstream.Message, events api.EventP
Percent: percent,
Status: status,
Text: jm.Status,
Details: progress,
Details: details,
})
}