diff --git a/nativeconverter/zstdchunked/zstdchunked.go b/nativeconverter/zstdchunked/zstdchunked.go index fc91fa0f6..a23bd7af4 100644 --- a/nativeconverter/zstdchunked/zstdchunked.go +++ b/nativeconverter/zstdchunked/zstdchunked.go @@ -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) } @@ -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 }