diff --git a/pkg/archive/archive.go b/pkg/archive/archive.go index 68dd4ab1d8..6d2a54e7c7 100644 --- a/pkg/archive/archive.go +++ b/pkg/archive/archive.go @@ -213,6 +213,12 @@ func DecompressStream(archive io.Reader) (io.ReadCloser, error) { readBufWrapper := p.NewReadCloserWrapper(buf, xzReader) return readBufWrapper, nil case Zstd: + cleanup := func() { + p.Put(buf) + } + if rc, canUse := tryProcFilter([]string{"zstd", "-d"}, buf, cleanup); canUse { + return rc, nil + } return zstdReader(buf) default: return nil, fmt.Errorf("unsupported compression format %s", (&compression).Extension())