c8d/progress: Show Mounted/Exists status
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
056be8b7b0
commit
bcbbd9538f
1 changed files with 14 additions and 2 deletions
|
@ -8,9 +8,11 @@ import (
|
|||
|
||||
"github.com/containerd/containerd/content"
|
||||
cerrdefs "github.com/containerd/containerd/errdefs"
|
||||
"github.com/containerd/containerd/images"
|
||||
"github.com/containerd/containerd/remotes"
|
||||
"github.com/containerd/containerd/remotes/docker"
|
||||
"github.com/containerd/log"
|
||||
"github.com/distribution/reference"
|
||||
"github.com/docker/docker/internal/compatcontext"
|
||||
"github.com/docker/docker/pkg/progress"
|
||||
"github.com/docker/docker/pkg/stringid"
|
||||
|
@ -209,8 +211,18 @@ func (p *pushProgress) UpdateProgress(ctx context.Context, ongoing *jobs, out pr
|
|||
}
|
||||
|
||||
if status.Committed && status.Offset >= status.Total {
|
||||
if p.isMountable(j.Digest) {
|
||||
progress.Update(out, id, "Mounted")
|
||||
if status.MountedFrom != "" {
|
||||
from := status.MountedFrom
|
||||
if ref, err := reference.ParseNormalizedNamed(from); err == nil {
|
||||
from = reference.Path(ref)
|
||||
}
|
||||
progress.Update(out, id, "Mounted from "+from)
|
||||
} else if status.Exists {
|
||||
if images.IsLayerType(j.MediaType) {
|
||||
progress.Update(out, id, "Layer already exists")
|
||||
} else {
|
||||
progress.Update(out, id, "Already exists")
|
||||
}
|
||||
} else {
|
||||
progress.Update(out, id, "Pushed")
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue