Skip to content

Commit

Permalink
Merge pull request #10287 from ktock/transfer-push-dup
Browse files Browse the repository at this point in the history
Transfer: Push: fix failure on pushing duplicated blobs
  • Loading branch information
mxpv committed Jun 4, 2024
2 parents 5d6a94a + 0e8cc91 commit 1369112
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/transfer/local/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,13 @@ func (p *progressPusher) WrapHandler(h images.Handler) images.Handler {
func (p *progressPusher) Push(ctx context.Context, d ocispec.Descriptor) (content.Writer, error) {
ref := remotes.MakeRefKey(ctx, d)
p.status.add(ref, d)
cw, err := p.Pusher.Push(ctx, d)
var cw content.Writer
var err error
if cs, ok := p.Pusher.(content.Ingester); ok {
cw, err = content.OpenWriter(ctx, cs, content.WithRef(ref), content.WithDescriptor(d))
} else {
cw, err = p.Pusher.Push(ctx, d)
}
if err != nil {
if errdefs.IsAlreadyExists(err) {
p.progress.MarkExists(d)
Expand Down

0 comments on commit 1369112

Please sign in to comment.