mirror of
https://github.com/moby/moby.git
synced 2026-07-13 11:00:42 +00:00
- pkg/archive: deprecate, and add aliases
Keeping the tests in this commit; also moves various utilities
into a _test.go file, as they were now only used in tests.
- pkg/chrootarchive: deprecate and add aliase
deprecate pkg/archive and add aliases
keeping the tests in this commit
- Add temporary exceptions for deprecation linting errors, because
this commit is to verify everything works with the aliases.
- remove tests that depend on un-exported types
=== RUN TestDisablePigz
--- FAIL: TestDisablePigz (0.00s)
panic: interface conversion: io.Reader is *archive.readCloserWrapper, not *archive.readCloserWrapper (types from different packages) [recovered]
- pkg/archive, pkg/chrootarchive: remove test files
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Derek McGowan <derek@mcg.dev>
38 lines
1.1 KiB
Go
38 lines
1.1 KiB
Go
package archive
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/moby/go-archive"
|
|
)
|
|
|
|
// UnpackLayer unpack `layer` to a `dest`.
|
|
//
|
|
// Deprecated: use [archive.UnpackLayer] instead.
|
|
func UnpackLayer(dest string, layer io.Reader, options *TarOptions) (size int64, err error) {
|
|
return archive.UnpackLayer(dest, layer, toArchiveOpt(options))
|
|
}
|
|
|
|
// ApplyLayer parses a diff in the standard layer format from `layer`,
|
|
// and applies it to the directory `dest`.
|
|
//
|
|
// Deprecated: use [archive.ApplyLayer] instead.
|
|
func ApplyLayer(dest string, layer io.Reader) (int64, error) {
|
|
return archive.ApplyLayer(dest, layer)
|
|
}
|
|
|
|
// ApplyUncompressedLayer parses a diff in the standard layer format from
|
|
// `layer`, and applies it to the directory `dest`.
|
|
//
|
|
// Deprecated: use [archive.ApplyUncompressedLayer] instead.
|
|
func ApplyUncompressedLayer(dest string, layer io.Reader, options *TarOptions) (int64, error) {
|
|
return archive.ApplyUncompressedLayer(dest, layer, toArchiveOpt(options))
|
|
}
|
|
|
|
// IsEmpty checks if the tar archive is empty (doesn't contain any entries).
|
|
//
|
|
// Deprecated: use [archive.IsEmpty] instead.
|
|
func IsEmpty(rd io.Reader) (bool, error) {
|
|
return archive.IsEmpty(rd)
|
|
}
|