summaryrefslogtreecommitdiff
path: root/vendor/github.com/docker
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/docker')
-rw-r--r--vendor/github.com/docker/docker/errdefs/defs.go69
-rw-r--r--vendor/github.com/docker/docker/errdefs/doc.go8
-rw-r--r--vendor/github.com/docker/docker/errdefs/helpers.go309
-rw-r--r--vendor/github.com/docker/docker/errdefs/http_helpers.go49
-rw-r--r--vendor/github.com/docker/docker/errdefs/is.go78
-rw-r--r--vendor/github.com/docker/docker/pkg/archive/archive_deprecated.go259
-rw-r--r--vendor/github.com/docker/docker/pkg/archive/changes_deprecated.go56
-rw-r--r--vendor/github.com/docker/docker/pkg/archive/copy_deprecated.go130
-rw-r--r--vendor/github.com/docker/docker/pkg/archive/diff_deprecated.go37
-rw-r--r--vendor/github.com/docker/docker/pkg/archive/path_deprecated.go10
-rw-r--r--vendor/github.com/docker/docker/pkg/archive/utils.go42
-rw-r--r--vendor/github.com/docker/docker/pkg/archive/whiteouts_deprecated.go10
-rw-r--r--vendor/github.com/docker/docker/pkg/archive/wrap_deprecated.go14
-rw-r--r--vendor/github.com/docker/docker/pkg/idtools/idtools.go223
-rw-r--r--vendor/github.com/docker/docker/pkg/idtools/idtools_windows.go12
15 files changed, 0 insertions, 1306 deletions
diff --git a/vendor/github.com/docker/docker/errdefs/defs.go b/vendor/github.com/docker/docker/errdefs/defs.go
deleted file mode 100644
index a5523c3..0000000
--- a/vendor/github.com/docker/docker/errdefs/defs.go
+++ /dev/null
@@ -1,69 +0,0 @@
-package errdefs
-
-// ErrNotFound signals that the requested object doesn't exist
-type ErrNotFound interface {
- NotFound()
-}
-
-// ErrInvalidParameter signals that the user input is invalid
-type ErrInvalidParameter interface {
- InvalidParameter()
-}
-
-// ErrConflict signals that some internal state conflicts with the requested action and can't be performed.
-// A change in state should be able to clear this error.
-type ErrConflict interface {
- Conflict()
-}
-
-// ErrUnauthorized is used to signify that the user is not authorized to perform a specific action
-type ErrUnauthorized interface {
- Unauthorized()
-}
-
-// ErrUnavailable signals that the requested action/subsystem is not available.
-type ErrUnavailable interface {
- Unavailable()
-}
-
-// ErrForbidden signals that the requested action cannot be performed under any circumstances.
-// When a ErrForbidden is returned, the caller should never retry the action.
-type ErrForbidden interface {
- Forbidden()
-}
-
-// ErrSystem signals that some internal error occurred.
-// An example of this would be a failed mount request.
-type ErrSystem interface {
- System()
-}
-
-// ErrNotModified signals that an action can't be performed because it's already in the desired state
-type ErrNotModified interface {
- NotModified()
-}
-
-// ErrNotImplemented signals that the requested action/feature is not implemented on the system as configured.
-type ErrNotImplemented interface {
- NotImplemented()
-}
-
-// ErrUnknown signals that the kind of error that occurred is not known.
-type ErrUnknown interface {
- Unknown()
-}
-
-// ErrCancelled signals that the action was cancelled.
-type ErrCancelled interface {
- Cancelled()
-}
-
-// ErrDeadline signals that the deadline was reached before the action completed.
-type ErrDeadline interface {
- DeadlineExceeded()
-}
-
-// ErrDataLoss indicates that data was lost or there is data corruption.
-type ErrDataLoss interface {
- DataLoss()
-}
diff --git a/vendor/github.com/docker/docker/errdefs/doc.go b/vendor/github.com/docker/docker/errdefs/doc.go
deleted file mode 100644
index efbe8ba..0000000
--- a/vendor/github.com/docker/docker/errdefs/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Package errdefs defines a set of error interfaces that packages should use for communicating classes of errors.
-// Errors that cross the package boundary should implement one (and only one) of these interfaces.
-//
-// Packages should not reference these interfaces directly, only implement them.
-// To check if a particular error implements one of these interfaces, there are helper
-// functions provided (e.g. `Is<SomeError>`) which can be used rather than asserting the interfaces directly.
-// If you must assert on these interfaces, be sure to check the causal chain (`err.Unwrap()`).
-package errdefs
diff --git a/vendor/github.com/docker/docker/errdefs/helpers.go b/vendor/github.com/docker/docker/errdefs/helpers.go
deleted file mode 100644
index 2a9f7ff..0000000
--- a/vendor/github.com/docker/docker/errdefs/helpers.go
+++ /dev/null
@@ -1,309 +0,0 @@
-package errdefs
-
-import (
- "context"
-
- cerrdefs "github.com/containerd/errdefs"
-)
-
-type errNotFound struct{ error }
-
-func (errNotFound) NotFound() {}
-
-func (e errNotFound) Cause() error {
- return e.error
-}
-
-func (e errNotFound) Unwrap() error {
- return e.error
-}
-
-// NotFound creates an [ErrNotFound] error from the given error.
-// It returns the error as-is if it is either nil (no error) or already implements
-// [ErrNotFound],
-func NotFound(err error) error {
- if err == nil || cerrdefs.IsNotFound(err) {
- return err
- }
- return errNotFound{err}
-}
-
-type errInvalidParameter struct{ error }
-
-func (errInvalidParameter) InvalidParameter() {}
-
-func (e errInvalidParameter) Cause() error {
- return e.error
-}
-
-func (e errInvalidParameter) Unwrap() error {
- return e.error
-}
-
-// InvalidParameter creates an [ErrInvalidParameter] error from the given error.
-// It returns the error as-is if it is either nil (no error) or already implements
-// [ErrInvalidParameter],
-func InvalidParameter(err error) error {
- if err == nil || cerrdefs.IsInvalidArgument(err) {
- return err
- }
- return errInvalidParameter{err}
-}
-
-type errConflict struct{ error }
-
-func (errConflict) Conflict() {}
-
-func (e errConflict) Cause() error {
- return e.error
-}
-
-func (e errConflict) Unwrap() error {
- return e.error
-}
-
-// Conflict creates an [ErrConflict] error from the given error.
-// It returns the error as-is if it is either nil (no error) or already implements
-// [ErrConflict],
-func Conflict(err error) error {
- if err == nil || cerrdefs.IsConflict(err) {
- return err
- }
- return errConflict{err}
-}
-
-type errUnauthorized struct{ error }
-
-func (errUnauthorized) Unauthorized() {}
-
-func (e errUnauthorized) Cause() error {
- return e.error
-}
-
-func (e errUnauthorized) Unwrap() error {
- return e.error
-}
-
-// Unauthorized creates an [ErrUnauthorized] error from the given error.
-// It returns the error as-is if it is either nil (no error) or already implements
-// [ErrUnauthorized],
-func Unauthorized(err error) error {
- if err == nil || cerrdefs.IsUnauthorized(err) {
- return err
- }
- return errUnauthorized{err}
-}
-
-type errUnavailable struct{ error }
-
-func (errUnavailable) Unavailable() {}
-
-func (e errUnavailable) Cause() error {
- return e.error
-}
-
-func (e errUnavailable) Unwrap() error {
- return e.error
-}
-
-// Unavailable creates an [ErrUnavailable] error from the given error.
-// It returns the error as-is if it is either nil (no error) or already implements
-// [ErrUnavailable],
-func Unavailable(err error) error {
- if err == nil || cerrdefs.IsUnavailable(err) {
- return err
- }
- return errUnavailable{err}
-}
-
-type errForbidden struct{ error }
-
-func (errForbidden) Forbidden() {}
-
-func (e errForbidden) Cause() error {
- return e.error
-}
-
-func (e errForbidden) Unwrap() error {
- return e.error
-}
-
-// Forbidden creates an [ErrForbidden] error from the given error.
-// It returns the error as-is if it is either nil (no error) or already implements
-// [ErrForbidden],
-func Forbidden(err error) error {
- if err == nil || cerrdefs.IsPermissionDenied(err) {
- return err
- }
- return errForbidden{err}
-}
-
-type errSystem struct{ error }
-
-func (errSystem) System() {}
-
-func (e errSystem) Cause() error {
- return e.error
-}
-
-func (e errSystem) Unwrap() error {
- return e.error
-}
-
-// System creates an [ErrSystem] error from the given error.
-// It returns the error as-is if it is either nil (no error) or already implements
-// [ErrSystem],
-func System(err error) error {
- if err == nil || cerrdefs.IsInternal(err) {
- return err
- }
- return errSystem{err}
-}
-
-type errNotModified struct{ error }
-
-func (errNotModified) NotModified() {}
-
-func (e errNotModified) Cause() error {
- return e.error
-}
-
-func (e errNotModified) Unwrap() error {
- return e.error
-}
-
-// NotModified creates an [ErrNotModified] error from the given error.
-// It returns the error as-is if it is either nil (no error) or already implements
-// [NotModified],
-func NotModified(err error) error {
- if err == nil || cerrdefs.IsNotModified(err) {
- return err
- }
- return errNotModified{err}
-}
-
-type errNotImplemented struct{ error }
-
-func (errNotImplemented) NotImplemented() {}
-
-func (e errNotImplemented) Cause() error {
- return e.error
-}
-
-func (e errNotImplemented) Unwrap() error {
- return e.error
-}
-
-// NotImplemented creates an [ErrNotImplemented] error from the given error.
-// It returns the error as-is if it is either nil (no error) or already implements
-// [ErrNotImplemented],
-func NotImplemented(err error) error {
- if err == nil || cerrdefs.IsNotImplemented(err) {
- return err
- }
- return errNotImplemented{err}
-}
-
-type errUnknown struct{ error }
-
-func (errUnknown) Unknown() {}
-
-func (e errUnknown) Cause() error {
- return e.error
-}
-
-func (e errUnknown) Unwrap() error {
- return e.error
-}
-
-// Unknown creates an [ErrUnknown] error from the given error.
-// It returns the error as-is if it is either nil (no error) or already implements
-// [ErrUnknown],
-func Unknown(err error) error {
- if err == nil || cerrdefs.IsUnknown(err) {
- return err
- }
- return errUnknown{err}
-}
-
-type errCancelled struct{ error }
-
-func (errCancelled) Cancelled() {}
-
-func (e errCancelled) Cause() error {
- return e.error
-}
-
-func (e errCancelled) Unwrap() error {
- return e.error
-}
-
-// Cancelled creates an [ErrCancelled] error from the given error.
-// It returns the error as-is if it is either nil (no error) or already implements
-// [ErrCancelled],
-func Cancelled(err error) error {
- if err == nil || cerrdefs.IsCanceled(err) {
- return err
- }
- return errCancelled{err}
-}
-
-type errDeadline struct{ error }
-
-func (errDeadline) DeadlineExceeded() {}
-
-func (e errDeadline) Cause() error {
- return e.error
-}
-
-func (e errDeadline) Unwrap() error {
- return e.error
-}
-
-// Deadline creates an [ErrDeadline] error from the given error.
-// It returns the error as-is if it is either nil (no error) or already implements
-// [ErrDeadline],
-func Deadline(err error) error {
- if err == nil || cerrdefs.IsDeadlineExceeded(err) {
- return err
- }
- return errDeadline{err}
-}
-
-type errDataLoss struct{ error }
-
-func (errDataLoss) DataLoss() {}
-
-func (e errDataLoss) Cause() error {
- return e.error
-}
-
-func (e errDataLoss) Unwrap() error {
- return e.error
-}
-
-// DataLoss creates an [ErrDataLoss] error from the given error.
-// It returns the error as-is if it is either nil (no error) or already implements
-// [ErrDataLoss],
-func DataLoss(err error) error {
- if err == nil || cerrdefs.IsDataLoss(err) {
- return err
- }
- return errDataLoss{err}
-}
-
-// FromContext returns the error class from the passed in context
-func FromContext(ctx context.Context) error {
- e := ctx.Err()
- if e == nil {
- return nil
- }
-
- if e == context.Canceled {
- return Cancelled(e)
- }
- if e == context.DeadlineExceeded {
- return Deadline(e)
- }
- return Unknown(e)
-}
diff --git a/vendor/github.com/docker/docker/errdefs/http_helpers.go b/vendor/github.com/docker/docker/errdefs/http_helpers.go
deleted file mode 100644
index 823ff2d..0000000
--- a/vendor/github.com/docker/docker/errdefs/http_helpers.go
+++ /dev/null
@@ -1,49 +0,0 @@
-package errdefs
-
-import (
- "net/http"
-)
-
-// FromStatusCode creates an errdef error, based on the provided HTTP status-code
-//
-// Deprecated: Use [cerrdefs.ToNative] instead
-func FromStatusCode(err error, statusCode int) error {
- if err == nil {
- return nil
- }
- switch statusCode {
- case http.StatusNotFound:
- return NotFound(err)
- case http.StatusBadRequest:
- return InvalidParameter(err)
- case http.StatusConflict:
- return Conflict(err)
- case http.StatusUnauthorized:
- return Unauthorized(err)
- case http.StatusServiceUnavailable:
- return Unavailable(err)
- case http.StatusForbidden:
- return Forbidden(err)
- case http.StatusNotModified:
- return NotModified(err)
- case http.StatusNotImplemented:
- return NotImplemented(err)
- case http.StatusInternalServerError:
- if IsCancelled(err) || IsSystem(err) || IsUnknown(err) || IsDataLoss(err) || IsDeadline(err) {
- return err
- }
- return System(err)
- default:
- switch {
- case statusCode >= http.StatusOK && statusCode < http.StatusBadRequest:
- // it's a client error
- return err
- case statusCode >= http.StatusBadRequest && statusCode < http.StatusInternalServerError:
- return InvalidParameter(err)
- case statusCode >= http.StatusInternalServerError && statusCode < 600:
- return System(err)
- default:
- return Unknown(err)
- }
- }
-}
diff --git a/vendor/github.com/docker/docker/errdefs/is.go b/vendor/github.com/docker/docker/errdefs/is.go
deleted file mode 100644
index ceb754a..0000000
--- a/vendor/github.com/docker/docker/errdefs/is.go
+++ /dev/null
@@ -1,78 +0,0 @@
-package errdefs
-
-import (
- "context"
- "errors"
-
- cerrdefs "github.com/containerd/errdefs"
-)
-
-// IsNotFound returns if the passed in error is an [ErrNotFound],
-//
-// Deprecated: use containerd [cerrdefs.IsNotFound]
-var IsNotFound = cerrdefs.IsNotFound
-
-// IsInvalidParameter returns if the passed in error is an [ErrInvalidParameter].
-//
-// Deprecated: use containerd [cerrdefs.IsInvalidArgument]
-var IsInvalidParameter = cerrdefs.IsInvalidArgument
-
-// IsConflict returns if the passed in error is an [ErrConflict].
-//
-// Deprecated: use containerd [cerrdefs.IsConflict]
-var IsConflict = cerrdefs.IsConflict
-
-// IsUnauthorized returns if the passed in error is an [ErrUnauthorized].
-//
-// Deprecated: use containerd [cerrdefs.IsUnauthorized]
-var IsUnauthorized = cerrdefs.IsUnauthorized
-
-// IsUnavailable returns if the passed in error is an [ErrUnavailable].
-//
-// Deprecated: use containerd [cerrdefs.IsUnavailable]
-var IsUnavailable = cerrdefs.IsUnavailable
-
-// IsForbidden returns if the passed in error is an [ErrForbidden].
-//
-// Deprecated: use containerd [cerrdefs.IsPermissionDenied]
-var IsForbidden = cerrdefs.IsPermissionDenied
-
-// IsSystem returns if the passed in error is an [ErrSystem].
-//
-// Deprecated: use containerd [cerrdefs.IsInternal]
-var IsSystem = cerrdefs.IsInternal
-
-// IsNotModified returns if the passed in error is an [ErrNotModified].
-//
-// Deprecated: use containerd [cerrdefs.IsNotModified]
-var IsNotModified = cerrdefs.IsNotModified
-
-// IsNotImplemented returns if the passed in error is an [ErrNotImplemented].
-//
-// Deprecated: use containerd [cerrdefs.IsNotImplemented]
-var IsNotImplemented = cerrdefs.IsNotImplemented
-
-// IsUnknown returns if the passed in error is an [ErrUnknown].
-//
-// Deprecated: use containerd [cerrdefs.IsUnknown]
-var IsUnknown = cerrdefs.IsUnknown
-
-// IsCancelled returns if the passed in error is an [ErrCancelled].
-//
-// Deprecated: use containerd [cerrdefs.IsCanceled]
-var IsCancelled = cerrdefs.IsCanceled
-
-// IsDeadline returns if the passed in error is an [ErrDeadline].
-//
-// Deprecated: use containerd [cerrdefs.IsDeadlineExceeded]
-var IsDeadline = cerrdefs.IsDeadlineExceeded
-
-// IsDataLoss returns if the passed in error is an [ErrDataLoss].
-//
-// Deprecated: use containerd [cerrdefs.IsDataLoss]
-var IsDataLoss = cerrdefs.IsDataLoss
-
-// IsContext returns if the passed in error is due to context cancellation or deadline exceeded.
-func IsContext(err error) bool {
- return errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded)
-}
diff --git a/vendor/github.com/docker/docker/pkg/archive/archive_deprecated.go b/vendor/github.com/docker/docker/pkg/archive/archive_deprecated.go
deleted file mode 100644
index 5bdbdef..0000000
--- a/vendor/github.com/docker/docker/pkg/archive/archive_deprecated.go
+++ /dev/null
@@ -1,259 +0,0 @@
-// Package archive provides helper functions for dealing with archive files.
-package archive
-
-import (
- "archive/tar"
- "io"
- "os"
-
- "github.com/docker/docker/pkg/idtools"
- "github.com/moby/go-archive"
- "github.com/moby/go-archive/compression"
- "github.com/moby/go-archive/tarheader"
-)
-
-// ImpliedDirectoryMode represents the mode (Unix permissions) applied to directories that are implied by files in a
-// tar, but that do not have their own header entry.
-//
-// Deprecated: use [archive.ImpliedDirectoryMode] instead.
-const ImpliedDirectoryMode = archive.ImpliedDirectoryMode
-
-type (
- // Compression is the state represents if compressed or not.
- //
- // Deprecated: use [compression.Compression] instead.
- Compression = compression.Compression
- // WhiteoutFormat is the format of whiteouts unpacked
- //
- // Deprecated: use [archive.WhiteoutFormat] instead.
- WhiteoutFormat = archive.WhiteoutFormat
-
- // TarOptions wraps the tar options.
- //
- // Deprecated: use [archive.TarOptions] instead.
- TarOptions struct {
- IncludeFiles []string
- ExcludePatterns []string
- Compression compression.Compression
- NoLchown bool
- IDMap idtools.IdentityMapping
- ChownOpts *idtools.Identity
- IncludeSourceDir bool
- // WhiteoutFormat is the expected on disk format for whiteout files.
- // This format will be converted to the standard format on pack
- // and from the standard format on unpack.
- WhiteoutFormat archive.WhiteoutFormat
- // When unpacking, specifies whether overwriting a directory with a
- // non-directory is allowed and vice versa.
- NoOverwriteDirNonDir bool
- // For each include when creating an archive, the included name will be
- // replaced with the matching name from this map.
- RebaseNames map[string]string
- InUserNS bool
- // Allow unpacking to succeed in spite of failures to set extended
- // attributes on the unpacked files due to the destination filesystem
- // not supporting them or a lack of permissions. Extended attributes
- // were probably in the archive for a reason, so set this option at
- // your own peril.
- BestEffortXattrs bool
- }
-)
-
-// Archiver implements the Archiver interface and allows the reuse of most utility functions of
-// this package with a pluggable Untar function. Also, to facilitate the passing of specific id
-// mappings for untar, an Archiver can be created with maps which will then be passed to Untar operations.
-//
-// Deprecated: use [archive.Archiver] instead.
-type Archiver struct {
- Untar func(io.Reader, string, *TarOptions) error
- IDMapping idtools.IdentityMapping
-}
-
-// NewDefaultArchiver returns a new Archiver without any IdentityMapping
-//
-// Deprecated: use [archive.NewDefaultArchiver] instead.
-func NewDefaultArchiver() *Archiver {
- return &Archiver{Untar: Untar}
-}
-
-const (
- Uncompressed = compression.None // Deprecated: use [compression.None] instead.
- Bzip2 = compression.Bzip2 // Deprecated: use [compression.Bzip2] instead.
- Gzip = compression.Gzip // Deprecated: use [compression.Gzip] instead.
- Xz = compression.Xz // Deprecated: use [compression.Xz] instead.
- Zstd = compression.Zstd // Deprecated: use [compression.Zstd] instead.
-)
-
-const (
- AUFSWhiteoutFormat = archive.AUFSWhiteoutFormat // Deprecated: use [archive.AUFSWhiteoutFormat] instead.
- OverlayWhiteoutFormat = archive.OverlayWhiteoutFormat // Deprecated: use [archive.OverlayWhiteoutFormat] instead.
-)
-
-// IsArchivePath checks if the (possibly compressed) file at the given path
-// starts with a tar file header.
-//
-// Deprecated: use [archive.IsArchivePath] instead.
-func IsArchivePath(path string) bool {
- return archive.IsArchivePath(path)
-}
-
-// DetectCompression detects the compression algorithm of the source.
-//
-// Deprecated: use [compression.Detect] instead.
-func DetectCompression(source []byte) archive.Compression {
- return compression.Detect(source)
-}
-
-// DecompressStream decompresses the archive and returns a ReaderCloser with the decompressed archive.
-//
-// Deprecated: use [compression.DecompressStream] instead.
-func DecompressStream(arch io.Reader) (io.ReadCloser, error) {
- return compression.DecompressStream(arch)
-}
-
-// CompressStream compresses the dest with specified compression algorithm.
-//
-// Deprecated: use [compression.CompressStream] instead.
-func CompressStream(dest io.Writer, comp compression.Compression) (io.WriteCloser, error) {
- return compression.CompressStream(dest, comp)
-}
-
-// TarModifierFunc is a function that can be passed to ReplaceFileTarWrapper.
-//
-// Deprecated: use [archive.TarModifierFunc] instead.
-type TarModifierFunc = archive.TarModifierFunc
-
-// ReplaceFileTarWrapper converts inputTarStream to a new tar stream.
-//
-// Deprecated: use [archive.ReplaceFileTarWrapper] instead.
-func ReplaceFileTarWrapper(inputTarStream io.ReadCloser, mods map[string]archive.TarModifierFunc) io.ReadCloser {
- return archive.ReplaceFileTarWrapper(inputTarStream, mods)
-}
-
-// FileInfoHeaderNoLookups creates a partially-populated tar.Header from fi.
-//
-// Deprecated: use [tarheader.FileInfoHeaderNoLookups] instead.
-func FileInfoHeaderNoLookups(fi os.FileInfo, link string) (*tar.Header, error) {
- return tarheader.FileInfoHeaderNoLookups(fi, link)
-}
-
-// FileInfoHeader creates a populated Header from fi.
-//
-// Deprecated: use [archive.FileInfoHeader] instead.
-func FileInfoHeader(name string, fi os.FileInfo, link string) (*tar.Header, error) {
- return archive.FileInfoHeader(name, fi, link)
-}
-
-// ReadSecurityXattrToTarHeader reads security.capability xattr from filesystem
-// to a tar header
-//
-// Deprecated: use [archive.ReadSecurityXattrToTarHeader] instead.
-func ReadSecurityXattrToTarHeader(path string, hdr *tar.Header) error {
- return archive.ReadSecurityXattrToTarHeader(path, hdr)
-}
-
-// Tar creates an archive from the directory at `path`, and returns it as a
-// stream of bytes.
-//
-// Deprecated: use [archive.Tar] instead.
-func Tar(path string, compression archive.Compression) (io.ReadCloser, error) {
- return archive.TarWithOptions(path, &archive.TarOptions{Compression: compression})
-}
-
-// TarWithOptions creates an archive with the given options.
-//
-// Deprecated: use [archive.TarWithOptions] instead.
-func TarWithOptions(srcPath string, options *TarOptions) (io.ReadCloser, error) {
- return archive.TarWithOptions(srcPath, toArchiveOpt(options))
-}
-
-// Tarballer is a lower-level interface to TarWithOptions.
-//
-// Deprecated: use [archive.Tarballer] instead.
-type Tarballer = archive.Tarballer
-
-// NewTarballer constructs a new tarballer using TarWithOptions.
-//
-// Deprecated: use [archive.Tarballer] instead.
-func NewTarballer(srcPath string, options *TarOptions) (*archive.Tarballer, error) {
- return archive.NewTarballer(srcPath, toArchiveOpt(options))
-}
-
-// Unpack unpacks the decompressedArchive to dest with options.
-//
-// Deprecated: use [archive.Unpack] instead.
-func Unpack(decompressedArchive io.Reader, dest string, options *TarOptions) error {
- return archive.Unpack(decompressedArchive, dest, toArchiveOpt(options))
-}
-
-// Untar reads a stream of bytes from `archive`, parses it as a tar archive,
-// and unpacks it into the directory at `dest`.
-//
-// Deprecated: use [archive.Untar] instead.
-func Untar(tarArchive io.Reader, dest string, options *TarOptions) error {
- return archive.Untar(tarArchive, dest, toArchiveOpt(options))
-}
-
-// UntarUncompressed reads a stream of bytes from `tarArchive`, parses it as a tar archive,
-// and unpacks it into the directory at `dest`.
-// The archive must be an uncompressed stream.
-//
-// Deprecated: use [archive.UntarUncompressed] instead.
-func UntarUncompressed(tarArchive io.Reader, dest string, options *TarOptions) error {
- return archive.UntarUncompressed(tarArchive, dest, toArchiveOpt(options))
-}
-
-// TarUntar is a convenience function which calls Tar and Untar, with the output of one piped into the other.
-// If either Tar or Untar fails, TarUntar aborts and returns the error.
-func (archiver *Archiver) TarUntar(src, dst string) error {
- return (&archive.Archiver{
- Untar: func(reader io.Reader, s string, options *archive.TarOptions) error {
- return archiver.Untar(reader, s, &TarOptions{
- IDMap: archiver.IDMapping,
- })
- },
- IDMapping: idtools.ToUserIdentityMapping(archiver.IDMapping),
- }).TarUntar(src, dst)
-}
-
-// UntarPath untar a file from path to a destination, src is the source tar file path.
-func (archiver *Archiver) UntarPath(src, dst string) error {
- return (&archive.Archiver{
- Untar: func(reader io.Reader, s string, options *archive.TarOptions) error {
- return archiver.Untar(reader, s, &TarOptions{
- IDMap: archiver.IDMapping,
- })
- },
- IDMapping: idtools.ToUserIdentityMapping(archiver.IDMapping),
- }).UntarPath(src, dst)
-}
-
-// CopyWithTar creates a tar archive of filesystem path `src`, and
-// unpacks it at filesystem path `dst`.
-// The archive is streamed directly with fixed buffering and no
-// intermediary disk IO.
-func (archiver *Archiver) CopyWithTar(src, dst string) error {
- return (&archive.Archiver{
- Untar: func(reader io.Reader, s string, options *archive.TarOptions) error {
- return archiver.Untar(reader, s, nil)
- },
- IDMapping: idtools.ToUserIdentityMapping(archiver.IDMapping),
- }).CopyWithTar(src, dst)
-}
-
-// CopyFileWithTar emulates the behavior of the 'cp' command-line
-// for a single file. It copies a regular file from path `src` to
-// path `dst`, and preserves all its metadata.
-func (archiver *Archiver) CopyFileWithTar(src, dst string) (err error) {
- return (&archive.Archiver{
- Untar: func(reader io.Reader, s string, options *archive.TarOptions) error {
- return archiver.Untar(reader, s, nil)
- },
- IDMapping: idtools.ToUserIdentityMapping(archiver.IDMapping),
- }).CopyFileWithTar(src, dst)
-}
-
-// IdentityMapping returns the IdentityMapping of the archiver.
-func (archiver *Archiver) IdentityMapping() idtools.IdentityMapping {
- return archiver.IDMapping
-}
diff --git a/vendor/github.com/docker/docker/pkg/archive/changes_deprecated.go b/vendor/github.com/docker/docker/pkg/archive/changes_deprecated.go
deleted file mode 100644
index 48c7523..0000000
--- a/vendor/github.com/docker/docker/pkg/archive/changes_deprecated.go
+++ /dev/null
@@ -1,56 +0,0 @@
-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))
-}
diff --git a/vendor/github.com/docker/docker/pkg/archive/copy_deprecated.go b/vendor/github.com/docker/docker/pkg/archive/copy_deprecated.go
deleted file mode 100644
index 1901e55..0000000
--- a/vendor/github.com/docker/docker/pkg/archive/copy_deprecated.go
+++ /dev/null
@@ -1,130 +0,0 @@
-package archive
-
-import (
- "io"
-
- "github.com/moby/go-archive"
- "github.com/moby/go-archive/compression"
-)
-
-var (
- ErrNotDirectory = archive.ErrNotDirectory // Deprecated: use [archive.ErrNotDirectory] instead.
- ErrDirNotExists = archive.ErrDirNotExists // Deprecated: use [archive.ErrDirNotExists] instead.
- ErrCannotCopyDir = archive.ErrCannotCopyDir // Deprecated: use [archive.ErrCannotCopyDir] instead.
- ErrInvalidCopySource = archive.ErrInvalidCopySource // Deprecated: use [archive.ErrInvalidCopySource] instead.
-)
-
-// PreserveTrailingDotOrSeparator returns the given cleaned path.
-//
-// Deprecated: use [archive.PreserveTrailingDotOrSeparator] instead.
-func PreserveTrailingDotOrSeparator(cleanedPath string, originalPath string) string {
- return archive.PreserveTrailingDotOrSeparator(cleanedPath, originalPath)
-}
-
-// SplitPathDirEntry splits the given path between its directory name and its
-// basename.
-//
-// Deprecated: use [archive.SplitPathDirEntry] instead.
-func SplitPathDirEntry(path string) (dir, base string) {
- return archive.SplitPathDirEntry(path)
-}
-
-// TarResource archives the resource described by the given CopyInfo to a Tar
-// archive.
-//
-// Deprecated: use [archive.TarResource] instead.
-func TarResource(sourceInfo archive.CopyInfo) (content io.ReadCloser, err error) {
- return archive.TarResource(sourceInfo)
-}
-
-// TarResourceRebase is like TarResource but renames the first path element of
-// items in the resulting tar archive to match the given rebaseName if not "".
-//
-// Deprecated: use [archive.TarResourceRebase] instead.
-func TarResourceRebase(sourcePath, rebaseName string) (content io.ReadCloser, _ error) {
- return archive.TarResourceRebase(sourcePath, rebaseName)
-}
-
-// TarResourceRebaseOpts does not preform the Tar, but instead just creates the rebase
-// parameters to be sent to TarWithOptions.
-//
-// Deprecated: use [archive.TarResourceRebaseOpts] instead.
-func TarResourceRebaseOpts(sourceBase string, rebaseName string) *TarOptions {
- filter := []string{sourceBase}
- return &TarOptions{
- Compression: compression.None,
- IncludeFiles: filter,
- IncludeSourceDir: true,
- RebaseNames: map[string]string{
- sourceBase: rebaseName,
- },
- }
-}
-
-// CopyInfo holds basic info about the source or destination path of a copy operation.
-//
-// Deprecated: use [archive.CopyInfo] instead.
-type CopyInfo = archive.CopyInfo
-
-// CopyInfoSourcePath stats the given path to create a CopyInfo struct.
-// struct representing that resource for the source of an archive copy
-// operation.
-//
-// Deprecated: use [archive.CopyInfoSourcePath] instead.
-func CopyInfoSourcePath(path string, followLink bool) (archive.CopyInfo, error) {
- return archive.CopyInfoSourcePath(path, followLink)
-}
-
-// CopyInfoDestinationPath stats the given path to create a CopyInfo
-// struct representing that resource for the destination of an archive copy
-// operation.
-//
-// Deprecated: use [archive.CopyInfoDestinationPath] instead.
-func CopyInfoDestinationPath(path string) (info archive.CopyInfo, err error) {
- return archive.CopyInfoDestinationPath(path)
-}
-
-// PrepareArchiveCopy prepares the given srcContent archive.
-//
-// Deprecated: use [archive.PrepareArchiveCopy] instead.
-func PrepareArchiveCopy(srcContent io.Reader, srcInfo, dstInfo archive.CopyInfo) (dstDir string, content io.ReadCloser, err error) {
- return archive.PrepareArchiveCopy(srcContent, srcInfo, dstInfo)
-}
-
-// RebaseArchiveEntries rewrites the given srcContent archive replacing
-// an occurrence of oldBase with newBase at the beginning of entry names.
-//
-// Deprecated: use [archive.RebaseArchiveEntries] instead.
-func RebaseArchiveEntries(srcContent io.Reader, oldBase, newBase string) io.ReadCloser {
- return archive.RebaseArchiveEntries(srcContent, oldBase, newBase)
-}
-
-// CopyResource performs an archive copy from the given source path to the
-// given destination path.
-//
-// Deprecated: use [archive.CopyResource] instead.
-func CopyResource(srcPath, dstPath string, followLink bool) error {
- return archive.CopyResource(srcPath, dstPath, followLink)
-}
-
-// CopyTo handles extracting the given content whose
-// entries should be sourced from srcInfo to dstPath.
-//
-// Deprecated: use [archive.CopyTo] instead.
-func CopyTo(content io.Reader, srcInfo archive.CopyInfo, dstPath string) error {
- return archive.CopyTo(content, srcInfo, dstPath)
-}
-
-// ResolveHostSourcePath decides real path need to be copied.
-//
-// Deprecated: use [archive.ResolveHostSourcePath] instead.
-func ResolveHostSourcePath(path string, followLink bool) (resolvedPath, rebaseName string, _ error) {
- return archive.ResolveHostSourcePath(path, followLink)
-}
-
-// GetRebaseName normalizes and compares path and resolvedPath.
-//
-// Deprecated: use [archive.GetRebaseName] instead.
-func GetRebaseName(path, resolvedPath string) (string, string) {
- return archive.GetRebaseName(path, resolvedPath)
-}
diff --git a/vendor/github.com/docker/docker/pkg/archive/diff_deprecated.go b/vendor/github.com/docker/docker/pkg/archive/diff_deprecated.go
deleted file mode 100644
index dd5e0d5..0000000
--- a/vendor/github.com/docker/docker/pkg/archive/diff_deprecated.go
+++ /dev/null
@@ -1,37 +0,0 @@
-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)
-}
diff --git a/vendor/github.com/docker/docker/pkg/archive/path_deprecated.go b/vendor/github.com/docker/docker/pkg/archive/path_deprecated.go
deleted file mode 100644
index 0fa74de..0000000
--- a/vendor/github.com/docker/docker/pkg/archive/path_deprecated.go
+++ /dev/null
@@ -1,10 +0,0 @@
-package archive
-
-import "github.com/moby/go-archive"
-
-// CheckSystemDriveAndRemoveDriveLetter verifies that a path is the system drive.
-//
-// Deprecated: use [archive.CheckSystemDriveAndRemoveDriveLetter] instead.
-func CheckSystemDriveAndRemoveDriveLetter(path string) (string, error) {
- return archive.CheckSystemDriveAndRemoveDriveLetter(path)
-}
diff --git a/vendor/github.com/docker/docker/pkg/archive/utils.go b/vendor/github.com/docker/docker/pkg/archive/utils.go
deleted file mode 100644
index 692cf16..0000000
--- a/vendor/github.com/docker/docker/pkg/archive/utils.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package archive
-
-import (
- "github.com/docker/docker/pkg/idtools"
- "github.com/moby/go-archive"
-)
-
-// ToArchiveOpt converts an [TarOptions] to a [archive.TarOptions].
-//
-// Deprecated: use [archive.TarOptions] instead, this utility is for internal use to transition to the [github.com/moby/go-archive] module.
-func ToArchiveOpt(options *TarOptions) *archive.TarOptions {
- return toArchiveOpt(options)
-}
-
-func toArchiveOpt(options *TarOptions) *archive.TarOptions {
- if options == nil {
- return nil
- }
-
- var chownOpts *archive.ChownOpts
- if options.ChownOpts != nil {
- chownOpts = &archive.ChownOpts{
- UID: options.ChownOpts.UID,
- GID: options.ChownOpts.GID,
- }
- }
-
- return &archive.TarOptions{
- IncludeFiles: options.IncludeFiles,
- ExcludePatterns: options.ExcludePatterns,
- Compression: options.Compression,
- NoLchown: options.NoLchown,
- IDMap: idtools.ToUserIdentityMapping(options.IDMap),
- ChownOpts: chownOpts,
- IncludeSourceDir: options.IncludeSourceDir,
- WhiteoutFormat: options.WhiteoutFormat,
- NoOverwriteDirNonDir: options.NoOverwriteDirNonDir,
- RebaseNames: options.RebaseNames,
- InUserNS: options.InUserNS,
- BestEffortXattrs: options.BestEffortXattrs,
- }
-}
diff --git a/vendor/github.com/docker/docker/pkg/archive/whiteouts_deprecated.go b/vendor/github.com/docker/docker/pkg/archive/whiteouts_deprecated.go
deleted file mode 100644
index 0ab8590..0000000
--- a/vendor/github.com/docker/docker/pkg/archive/whiteouts_deprecated.go
+++ /dev/null
@@ -1,10 +0,0 @@
-package archive
-
-import "github.com/moby/go-archive"
-
-const (
- WhiteoutPrefix = archive.WhiteoutPrefix // Deprecated: use [archive.WhiteoutPrefix] instead.
- WhiteoutMetaPrefix = archive.WhiteoutMetaPrefix // Deprecated: use [archive.WhiteoutMetaPrefix] instead.
- WhiteoutLinkDir = archive.WhiteoutLinkDir // Deprecated: use [archive.WhiteoutLinkDir] instead.
- WhiteoutOpaqueDir = archive.WhiteoutOpaqueDir // Deprecated: use [archive.WhiteoutOpaqueDir] instead.
-)
diff --git a/vendor/github.com/docker/docker/pkg/archive/wrap_deprecated.go b/vendor/github.com/docker/docker/pkg/archive/wrap_deprecated.go
deleted file mode 100644
index e5d3fa9..0000000
--- a/vendor/github.com/docker/docker/pkg/archive/wrap_deprecated.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package archive
-
-import (
- "io"
-
- "github.com/moby/go-archive"
-)
-
-// Generate generates a new archive from the content provided as input.
-//
-// Deprecated: use [archive.Generate] instead.
-func Generate(input ...string) (io.Reader, error) {
- return archive.Generate(input...)
-}
diff --git a/vendor/github.com/docker/docker/pkg/idtools/idtools.go b/vendor/github.com/docker/docker/pkg/idtools/idtools.go
deleted file mode 100644
index 982f81d..0000000
--- a/vendor/github.com/docker/docker/pkg/idtools/idtools.go
+++ /dev/null
@@ -1,223 +0,0 @@
-package idtools
-
-import (
- "fmt"
- "os"
-
- "github.com/moby/sys/user"
-)
-
-// IDMap contains a single entry for user namespace range remapping. An array
-// of IDMap entries represents the structure that will be provided to the Linux
-// kernel for creating a user namespace.
-//
-// Deprecated: use [user.IDMap] instead.
-type IDMap struct {
- ContainerID int `json:"container_id"`
- HostID int `json:"host_id"`
- Size int `json:"size"`
-}
-
-// MkdirAllAndChown creates a directory (include any along the path) and then modifies
-// ownership to the requested uid/gid. If the directory already exists, this
-// function will still change ownership and permissions.
-//
-// Deprecated: use [user.MkdirAllAndChown] instead.
-func MkdirAllAndChown(path string, mode os.FileMode, owner Identity) error {
- return user.MkdirAllAndChown(path, mode, owner.UID, owner.GID)
-}
-
-// MkdirAndChown creates a directory and then modifies ownership to the requested uid/gid.
-// If the directory already exists, this function still changes ownership and permissions.
-// Note that unlike os.Mkdir(), this function does not return IsExist error
-// in case path already exists.
-//
-// Deprecated: use [user.MkdirAndChown] instead.
-func MkdirAndChown(path string, mode os.FileMode, owner Identity) error {
- return user.MkdirAndChown(path, mode, owner.UID, owner.GID)
-}
-
-// MkdirAllAndChownNew creates a directory (include any along the path) and then modifies
-// ownership ONLY of newly created directories to the requested uid/gid. If the
-// directories along the path exist, no change of ownership or permissions will be performed
-//
-// Deprecated: use [user.MkdirAllAndChown] with the [user.WithOnlyNew] option instead.
-func MkdirAllAndChownNew(path string, mode os.FileMode, owner Identity) error {
- return user.MkdirAllAndChown(path, mode, owner.UID, owner.GID, user.WithOnlyNew)
-}
-
-// GetRootUIDGID retrieves the remapped root uid/gid pair from the set of maps.
-// If the maps are empty, then the root uid/gid will default to "real" 0/0
-//
-// Deprecated: use [(user.IdentityMapping).RootPair] instead.
-func GetRootUIDGID(uidMap, gidMap []IDMap) (int, int, error) {
- return getRootUIDGID(uidMap, gidMap)
-}
-
-// getRootUIDGID retrieves the remapped root uid/gid pair from the set of maps.
-// If the maps are empty, then the root uid/gid will default to "real" 0/0
-func getRootUIDGID(uidMap, gidMap []IDMap) (int, int, error) {
- uid, err := toHost(0, uidMap)
- if err != nil {
- return -1, -1, err
- }
- gid, err := toHost(0, gidMap)
- if err != nil {
- return -1, -1, err
- }
- return uid, gid, nil
-}
-
-// toContainer takes an id mapping, and uses it to translate a
-// host ID to the remapped ID. If no map is provided, then the translation
-// assumes a 1-to-1 mapping and returns the passed in id
-func toContainer(hostID int, idMap []IDMap) (int, error) {
- if idMap == nil {
- return hostID, nil
- }
- for _, m := range idMap {
- if (hostID >= m.HostID) && (hostID <= (m.HostID + m.Size - 1)) {
- contID := m.ContainerID + (hostID - m.HostID)
- return contID, nil
- }
- }
- return -1, fmt.Errorf("Host ID %d cannot be mapped to a container ID", hostID)
-}
-
-// toHost takes an id mapping and a remapped ID, and translates the
-// ID to the mapped host ID. If no map is provided, then the translation
-// assumes a 1-to-1 mapping and returns the passed in id #
-func toHost(contID int, idMap []IDMap) (int, error) {
- if idMap == nil {
- return contID, nil
- }
- for _, m := range idMap {
- if (contID >= m.ContainerID) && (contID <= (m.ContainerID + m.Size - 1)) {
- hostID := m.HostID + (contID - m.ContainerID)
- return hostID, nil
- }
- }
- return -1, fmt.Errorf("Container ID %d cannot be mapped to a host ID", contID)
-}
-
-// Identity is either a UID and GID pair or a SID (but not both)
-type Identity struct {
- UID int
- GID int
- SID string
-}
-
-// Chown changes the numeric uid and gid of the named file to id.UID and id.GID.
-//
-// Deprecated: this method is deprecated and will be removed in the next release.
-func (id Identity) Chown(name string) error {
- return os.Chown(name, id.UID, id.GID)
-}
-
-// IdentityMapping contains a mappings of UIDs and GIDs.
-// The zero value represents an empty mapping.
-//
-// Deprecated: this type is deprecated and will be removed in the next release.
-type IdentityMapping struct {
- UIDMaps []IDMap `json:"UIDMaps"`
- GIDMaps []IDMap `json:"GIDMaps"`
-}
-
-// FromUserIdentityMapping converts a [user.IdentityMapping] to an [idtools.IdentityMapping].
-//
-// Deprecated: use [user.IdentityMapping] directly, this is transitioning to user package.
-func FromUserIdentityMapping(u user.IdentityMapping) IdentityMapping {
- return IdentityMapping{
- UIDMaps: fromUserIDMap(u.UIDMaps),
- GIDMaps: fromUserIDMap(u.GIDMaps),
- }
-}
-
-func fromUserIDMap(u []user.IDMap) []IDMap {
- if u == nil {
- return nil
- }
- m := make([]IDMap, len(u))
- for i := range u {
- m[i] = IDMap{
- ContainerID: int(u[i].ID),
- HostID: int(u[i].ParentID),
- Size: int(u[i].Count),
- }
- }
- return m
-}
-
-// ToUserIdentityMapping converts an [idtools.IdentityMapping] to a [user.IdentityMapping].
-//
-// Deprecated: use [user.IdentityMapping] directly, this is transitioning to user package.
-func ToUserIdentityMapping(u IdentityMapping) user.IdentityMapping {
- return user.IdentityMapping{
- UIDMaps: toUserIDMap(u.UIDMaps),
- GIDMaps: toUserIDMap(u.GIDMaps),
- }
-}
-
-func toUserIDMap(u []IDMap) []user.IDMap {
- if u == nil {
- return nil
- }
- m := make([]user.IDMap, len(u))
- for i := range u {
- m[i] = user.IDMap{
- ID: int64(u[i].ContainerID),
- ParentID: int64(u[i].HostID),
- Count: int64(u[i].Size),
- }
- }
- return m
-}
-
-// RootPair returns a uid and gid pair for the root user. The error is ignored
-// because a root user always exists, and the defaults are correct when the uid
-// and gid maps are empty.
-func (i IdentityMapping) RootPair() Identity {
- uid, gid, _ := getRootUIDGID(i.UIDMaps, i.GIDMaps)
- return Identity{UID: uid, GID: gid}
-}
-
-// ToHost returns the host UID and GID for the container uid, gid.
-// Remapping is only performed if the ids aren't already the remapped root ids
-func (i IdentityMapping) ToHost(pair Identity) (Identity, error) {
- var err error
- target := i.RootPair()
-
- if pair.UID != target.UID {
- target.UID, err = toHost(pair.UID, i.UIDMaps)
- if err != nil {
- return target, err
- }
- }
-
- if pair.GID != target.GID {
- target.GID, err = toHost(pair.GID, i.GIDMaps)
- }
- return target, err
-}
-
-// ToContainer returns the container UID and GID for the host uid and gid
-func (i IdentityMapping) ToContainer(pair Identity) (int, int, error) {
- uid, err := toContainer(pair.UID, i.UIDMaps)
- if err != nil {
- return -1, -1, err
- }
- gid, err := toContainer(pair.GID, i.GIDMaps)
- return uid, gid, err
-}
-
-// Empty returns true if there are no id mappings
-func (i IdentityMapping) Empty() bool {
- return len(i.UIDMaps) == 0 && len(i.GIDMaps) == 0
-}
-
-// CurrentIdentity returns the identity of the current process
-//
-// Deprecated: use [os.Getuid] and [os.Getegid] instead.
-func CurrentIdentity() Identity {
- return Identity{UID: os.Getuid(), GID: os.Getegid()}
-}
diff --git a/vendor/github.com/docker/docker/pkg/idtools/idtools_windows.go b/vendor/github.com/docker/docker/pkg/idtools/idtools_windows.go
deleted file mode 100644
index f83f59f..0000000
--- a/vendor/github.com/docker/docker/pkg/idtools/idtools_windows.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package idtools
-
-const (
- SeTakeOwnershipPrivilege = "SeTakeOwnershipPrivilege"
-)
-
-// TODO(thaJeztah): these magic consts need a source of reference, and should be defined in a canonical location
-const (
- ContainerAdministratorSidString = "S-1-5-93-2-1"
-
- ContainerUserSidString = "S-1-5-93-2-2"
-)