Skip to content

Commit

Permalink
Merge pull request #1894 from ktock/bp-1885
Browse files Browse the repository at this point in the history
[v0.16] Fix zstd:chunked converter error on duplicated blobs
  • Loading branch information
AkihiroSuda authored Dec 12, 2024
2 parents 1d34a1b + 9b706a2 commit 86bbdeb
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions nativeconverter/zstdchunked/zstdchunked.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@ func LayerConvertFuncWithCompressionLevel(compressionLevel zstd.EncoderLevel, op
if uncompressedDesc == nil {
return nil, fmt.Errorf("unexpectedly got the same blob after compression (%s, %q)", desc.Digest, desc.MediaType)
}
defer func() {
if err := cs.Delete(ctx, uncompressedDesc.Digest); err != nil {
log.G(ctx).WithError(err).WithField("uncompressedDesc", uncompressedDesc).Warn("failed to remove tmp uncompressed layer")
}
}()
log.G(ctx).Debugf("zstdchunked: uncompressed %s into %s", desc.Digest, uncompressedDesc.Digest)
}

Expand Down Expand Up @@ -146,7 +141,7 @@ func LayerConvertFuncWithCompressionLevel(compressionLevel zstd.EncoderLevel, op
}
defer blob.Close()
ref := fmt.Sprintf("convert-zstdchunked-from-%s", desc.Digest)
w, err := cs.Writer(ctx, content.WithRef(ref))
w, err := content.OpenWriter(ctx, cs, content.WithRef(ref))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 86bbdeb

Please sign in to comment.