|
@@ -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")
|
|
|
}
|