Commit Graph

6 Commits

Author SHA1 Message Date
Giuseppe Scrivano 1a704f7c6e
chunked: add no-compression option for ZstdWriter
a new function NoCompression() is added to provide a way to create
uncompressed zstd:chunked files.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-06-09 13:17:22 +02:00
Miloslav Trmač f4597cfee5 Use range iterations
... for the trivial cases where the loop body does not reference
the iteration variable at all.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-09-05 18:56:35 +02:00
Miloslav Trmač 7f0dae6fea Rename ReadByte to readByte
It is only used internally, and this avoids a warning
about a conflict with io.ByteReader.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-14 17:17:53 +02:00
Miloslav Trmač 5e410ef763 Misc individual warning fixes
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-14 17:17:53 +02:00
Nalin Dahyabhai 14e95ef777 Don't try to use %w in testing package logging functions
Go 1.18's testing package is adamant that it doesn't support the %w
specifier for wrapping errors, which makes sense because it outputs
text rather than producing an error object like fmt.Errorf() does.
Change attempts to use %w to %v.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2022-06-01 10:55:08 -04:00
Giuseppe Scrivano 198820877c
pkg/chunked: add support for sparse files
automatically detect holes in sparse files (the threshold is hardcoded
at 1kb for now) and add this information to the manifest file.

The receiver will create a hole (using unix.Seek and unix.Ftruncate)
instead of writing the actual zeros.

Closes: https://github.com/containers/storage/issues/1091

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-01-13 13:32:13 +01:00