Only pass an io.Reader to invokeUnpack

... which allows us to remove an unnecessary NopCloser.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač 2022-09-26 22:31:35 +02:00
parent 2d90000b09
commit f3316c595f
3 changed files with 3 additions and 3 deletions

View File

@ -82,7 +82,7 @@ func untarHandler(tarArchive io.Reader, dest string, options *archive.TarOptions
}
}
r := io.NopCloser(tarArchive)
r := tarArchive
if decompress {
decompressedArchive, err := archive.DecompressStream(tarArchive)
if err != nil {

View File

@ -6,7 +6,7 @@ import (
"github.com/containers/storage/pkg/archive"
)
func invokeUnpack(decompressedArchive io.ReadCloser,
func invokeUnpack(decompressedArchive io.Reader,
dest string,
options *archive.TarOptions, root string) error {
return archive.Unpack(decompressedArchive, dest, options)

View File

@ -12,7 +12,7 @@ func chroot(path string) error {
return nil
}
func invokeUnpack(decompressedArchive io.ReadCloser,
func invokeUnpack(decompressedArchive io.Reader,
dest string,
options *archive.TarOptions, root string) error {
// Windows is different to Linux here because Windows does not support