Skip to content

Commit

Permalink
Work around pierrec/lz4#212
Browse files Browse the repository at this point in the history
This happens when attempting to compress a disk that is empty (0 bytes).
  • Loading branch information
edigaryev committed Nov 22, 2023
1 parent 7d17879 commit e74921c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/oci/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,12 @@ func pushDisk(
}

chunker, err := chunkerpkg.NewChunker(targetDiskLayerSizeBytes, func(w io.Writer) (io.WriteCloser, error) {
return lz4.NewWriter(w), nil
lz4Writer := lz4.NewWriter(w)

// Work around https://github.com/pierrec/lz4/pull/212
_, _ = lz4Writer.Write([]byte{})

return lz4Writer, nil
})
if err != nil {
return []types.Descriptor{}, err
Expand Down

0 comments on commit e74921c

Please sign in to comment.