Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transfer: Push: fix failure on pushing duplicated blobs #10287

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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