c8d/push: Show progress only on blobs
To match the graphdriver's push behavior which only shows the progress for layers. Exclude indexes, manifests and image configs from the push progress. Don't explicitly check for `IsLayerType` to also handle other potentially big blobs (like buildkit attestations). Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
591c98cdbe
commit
77f7c83114
1 changed files with 8 additions and 10 deletions
|
@ -134,24 +134,22 @@ func (i *ImageService) pushRef(ctx context.Context, targetRef reference.Named, m
|
|||
return err
|
||||
}
|
||||
|
||||
addChildrenToJobs := containerdimages.HandlerFunc(
|
||||
addLayerJobs := containerdimages.HandlerFunc(
|
||||
func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
|
||||
children, err := containerdimages.Children(ctx, store, desc)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
switch {
|
||||
case containerdimages.IsIndexType(desc.MediaType),
|
||||
containerdimages.IsManifestType(desc.MediaType),
|
||||
containerdimages.IsConfigType(desc.MediaType):
|
||||
default:
|
||||
jobsQueue.Add(desc)
|
||||
}
|
||||
for _, c := range children {
|
||||
jobsQueue.Add(c)
|
||||
}
|
||||
|
||||
jobsQueue.Add(desc)
|
||||
|
||||
return nil, nil
|
||||
},
|
||||
)
|
||||
|
||||
handlerWrapper := func(h images.Handler) images.Handler {
|
||||
return containerdimages.Handlers(addChildrenToJobs, h)
|
||||
return containerdimages.Handlers(addLayerJobs, h)
|
||||
}
|
||||
|
||||
err = remotes.PushContent(ctx, pusher, target, store, limiter, platforms.All, handlerWrapper)
|
||||
|
|
Loading…
Add table
Reference in a new issue