Files
moby/pkg/archive/changes_deprecated.go
Derek McGowan 57a042b77c deprecate pkg/(chroot)archive for github.com/moby/go-archive
- 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>
2025-04-08 10:56:58 -07:00

57 lines
1.8 KiB
Go

package archive
import (
"io"
"github.com/docker/docker/pkg/idtools"
"github.com/moby/go-archive"
)
// ChangeType represents the change
//
// Deprecated: use [archive.ChangeType] instead.
type ChangeType = archive.ChangeType
const (
ChangeModify = archive.ChangeModify // Deprecated: use [archive.ChangeModify] instead.
ChangeAdd = archive.ChangeAdd // Deprecated: use [archive.ChangeAdd] instead.
ChangeDelete = archive.ChangeDelete // Deprecated: use [archive.ChangeDelete] instead.
)
// Change represents a change.
//
// Deprecated: use [archive.Change] instead.
type Change = archive.Change
// Changes walks the path rw and determines changes for the files in the path,
// with respect to the parent layers
//
// Deprecated: use [archive.Changes] instead.
func Changes(layers []string, rw string) ([]archive.Change, error) {
return archive.Changes(layers, rw)
}
// FileInfo describes the information of a file.
//
// Deprecated: use [archive.FileInfo] instead.
type FileInfo = archive.FileInfo
// ChangesDirs compares two directories and generates an array of Change objects describing the changes.
//
// Deprecated: use [archive.ChangesDirs] instead.
func ChangesDirs(newDir, oldDir string) ([]archive.Change, error) {
return archive.ChangesDirs(newDir, oldDir)
}
// ChangesSize calculates the size in bytes of the provided changes, based on newDir.
//
// Deprecated: use [archive.ChangesSize] instead.
func ChangesSize(newDir string, changes []archive.Change) int64 {
return archive.ChangesSize(newDir, changes)
}
// ExportChanges produces an Archive from the provided changes, relative to dir.
func ExportChanges(dir string, changes []archive.Change, idMap idtools.IdentityMapping) (io.ReadCloser, error) {
return archive.ExportChanges(dir, changes, idtools.ToUserIdentityMapping(idMap))
}