Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -23,10 +23,10 @@ type execBackend interface {
|
| 23 | 23 |
|
| 24 | 24 |
// copyBackend includes functions to implement to provide container copy functionality. |
| 25 | 25 |
type copyBackend interface {
|
| 26 |
- ContainerArchivePath(name string, path string) (content io.ReadCloser, stat *types.ContainerPathStat, err error) |
|
| 26 |
+ ContainerArchivePath(name string, path string) (content io.ReadCloser, stat *container.PathStat, err error) |
|
| 27 | 27 |
ContainerExport(ctx context.Context, name string, out io.Writer) error |
| 28 | 28 |
ContainerExtractToDir(name, path string, copyUIDGID, noOverwriteDirNonDir bool, content io.Reader) error |
| 29 |
- ContainerStatPath(name string, path string) (stat *types.ContainerPathStat, err error) |
|
| 29 |
+ ContainerStatPath(name string, path string) (stat *container.PathStat, err error) |
|
| 30 | 30 |
} |
| 31 | 31 |
|
| 32 | 32 |
// stateBackend includes functions to implement to provide container state lifecycle functionality. |
| ... | ... |
@@ -10,12 +10,12 @@ import ( |
| 10 | 10 |
"net/http" |
| 11 | 11 |
|
| 12 | 12 |
"github.com/docker/docker/api/server/httputils" |
| 13 |
- "github.com/docker/docker/api/types" |
|
| 13 |
+ "github.com/docker/docker/api/types/container" |
|
| 14 | 14 |
gddohttputil "github.com/golang/gddo/httputil" |
| 15 | 15 |
) |
| 16 | 16 |
|
| 17 | 17 |
// setContainerPathStatHeader encodes the stat to JSON, base64 encode, and place in a header. |
| 18 |
-func setContainerPathStatHeader(stat *types.ContainerPathStat, header http.Header) error {
|
|
| 18 |
+func setContainerPathStatHeader(stat *container.PathStat, header http.Header) error {
|
|
| 19 | 19 |
statJSON, err := json.Marshal(stat) |
| 20 | 20 |
if err != nil {
|
| 21 | 21 |
return err |
| ... | ... |
@@ -1,8 +1,24 @@ |
| 1 | 1 |
package container |
| 2 | 2 |
|
| 3 |
+import ( |
|
| 4 |
+ "os" |
|
| 5 |
+ "time" |
|
| 6 |
+) |
|
| 7 |
+ |
|
| 3 | 8 |
// PruneReport contains the response for Engine API: |
| 4 | 9 |
// POST "/containers/prune" |
| 5 | 10 |
type PruneReport struct {
|
| 6 | 11 |
ContainersDeleted []string |
| 7 | 12 |
SpaceReclaimed uint64 |
| 8 | 13 |
} |
| 14 |
+ |
|
| 15 |
+// PathStat is used to encode the header from |
|
| 16 |
+// GET "/containers/{name:.*}/archive"
|
|
| 17 |
+// "Name" is the file or directory name. |
|
| 18 |
+type PathStat struct {
|
|
| 19 |
+ Name string `json:"name"` |
|
| 20 |
+ Size int64 `json:"size"` |
|
| 21 |
+ Mode os.FileMode `json:"mode"` |
|
| 22 |
+ Mtime time.Time `json:"mtime"` |
|
| 23 |
+ LinkTarget string `json:"linkTarget"` |
|
| 24 |
+} |
| ... | ... |
@@ -2,7 +2,6 @@ package types // import "github.com/docker/docker/api/types" |
| 2 | 2 |
|
| 3 | 3 |
import ( |
| 4 | 4 |
"io" |
| 5 |
- "os" |
|
| 6 | 5 |
"time" |
| 7 | 6 |
|
| 8 | 7 |
"github.com/docker/docker/api/types/container" |
| ... | ... |
@@ -162,17 +161,6 @@ type Container struct {
|
| 162 | 162 |
Mounts []MountPoint |
| 163 | 163 |
} |
| 164 | 164 |
|
| 165 |
-// ContainerPathStat is used to encode the header from |
|
| 166 |
-// GET "/containers/{name:.*}/archive"
|
|
| 167 |
-// "Name" is the file or directory name. |
|
| 168 |
-type ContainerPathStat struct {
|
|
| 169 |
- Name string `json:"name"` |
|
| 170 |
- Size int64 `json:"size"` |
|
| 171 |
- Mode os.FileMode `json:"mode"` |
|
| 172 |
- Mtime time.Time `json:"mtime"` |
|
| 173 |
- LinkTarget string `json:"linkTarget"` |
|
| 174 |
-} |
|
| 175 |
- |
|
| 176 | 165 |
// ContainerStats contains response of Engine API: |
| 177 | 166 |
// GET "/stats" |
| 178 | 167 |
type ContainerStats struct {
|
| ... | ... |
@@ -78,3 +78,10 @@ type ContainerExecInspect = container.ExecInspect |
| 78 | 78 |
// |
| 79 | 79 |
// Deprecated: use [container.PruneReport]. |
| 80 | 80 |
type ContainersPruneReport = container.PruneReport |
| 81 |
+ |
|
| 82 |
+// ContainerPathStat is used to encode the header from |
|
| 83 |
+// GET "/containers/{name:.*}/archive"
|
|
| 84 |
+// "Name" is the file or directory name. |
|
| 85 |
+// |
|
| 86 |
+// Deprecated: use [container.PathStat]. |
|
| 87 |
+type ContainerPathStat = container.PathStat |
| ... | ... |
@@ -12,10 +12,11 @@ import ( |
| 12 | 12 |
"strings" |
| 13 | 13 |
|
| 14 | 14 |
"github.com/docker/docker/api/types" |
| 15 |
+ "github.com/docker/docker/api/types/container" |
|
| 15 | 16 |
) |
| 16 | 17 |
|
| 17 | 18 |
// ContainerStatPath returns stat information about a path inside the container filesystem. |
| 18 |
-func (cli *Client) ContainerStatPath(ctx context.Context, containerID, path string) (types.ContainerPathStat, error) {
|
|
| 19 |
+func (cli *Client) ContainerStatPath(ctx context.Context, containerID, path string) (container.PathStat, error) {
|
|
| 19 | 20 |
query := url.Values{}
|
| 20 | 21 |
query.Set("path", filepath.ToSlash(path)) // Normalize the paths used in the API.
|
| 21 | 22 |
|
| ... | ... |
@@ -23,7 +24,7 @@ func (cli *Client) ContainerStatPath(ctx context.Context, containerID, path stri |
| 23 | 23 |
response, err := cli.head(ctx, urlStr, query, nil) |
| 24 | 24 |
defer ensureReaderClosed(response) |
| 25 | 25 |
if err != nil {
|
| 26 |
- return types.ContainerPathStat{}, err
|
|
| 26 |
+ return container.PathStat{}, err
|
|
| 27 | 27 |
} |
| 28 | 28 |
return getContainerPathStatFromHeader(response.header) |
| 29 | 29 |
} |
| ... | ... |
@@ -55,14 +56,14 @@ func (cli *Client) CopyToContainer(ctx context.Context, containerID, dstPath str |
| 55 | 55 |
|
| 56 | 56 |
// CopyFromContainer gets the content from the container and returns it as a Reader |
| 57 | 57 |
// for a TAR archive to manipulate it in the host. It's up to the caller to close the reader. |
| 58 |
-func (cli *Client) CopyFromContainer(ctx context.Context, containerID, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) {
|
|
| 58 |
+func (cli *Client) CopyFromContainer(ctx context.Context, containerID, srcPath string) (io.ReadCloser, container.PathStat, error) {
|
|
| 59 | 59 |
query := make(url.Values, 1) |
| 60 | 60 |
query.Set("path", filepath.ToSlash(srcPath)) // Normalize the paths used in the API.
|
| 61 | 61 |
|
| 62 | 62 |
apiPath := "/containers/" + containerID + "/archive" |
| 63 | 63 |
response, err := cli.get(ctx, apiPath, query, nil) |
| 64 | 64 |
if err != nil {
|
| 65 |
- return nil, types.ContainerPathStat{}, err
|
|
| 65 |
+ return nil, container.PathStat{}, err
|
|
| 66 | 66 |
} |
| 67 | 67 |
|
| 68 | 68 |
// In order to get the copy behavior right, we need to know information |
| ... | ... |
@@ -78,8 +79,8 @@ func (cli *Client) CopyFromContainer(ctx context.Context, containerID, srcPath s |
| 78 | 78 |
return response.body, stat, err |
| 79 | 79 |
} |
| 80 | 80 |
|
| 81 |
-func getContainerPathStatFromHeader(header http.Header) (types.ContainerPathStat, error) {
|
|
| 82 |
- var stat types.ContainerPathStat |
|
| 81 |
+func getContainerPathStatFromHeader(header http.Header) (container.PathStat, error) {
|
|
| 82 |
+ var stat container.PathStat |
|
| 83 | 83 |
|
| 84 | 84 |
encodedStat := header.Get("X-Docker-Container-Path-Stat")
|
| 85 | 85 |
statDecoder := base64.NewDecoder(base64.StdEncoding, strings.NewReader(encodedStat)) |
| ... | ... |
@@ -12,6 +12,7 @@ import ( |
| 12 | 12 |
"testing" |
| 13 | 13 |
|
| 14 | 14 |
"github.com/docker/docker/api/types" |
| 15 |
+ "github.com/docker/docker/api/types/container" |
|
| 15 | 16 |
"github.com/docker/docker/errdefs" |
| 16 | 17 |
"gotest.tools/v3/assert" |
| 17 | 18 |
is "gotest.tools/v3/assert/cmp" |
| ... | ... |
@@ -64,7 +65,7 @@ func TestContainerStatPath(t *testing.T) {
|
| 64 | 64 |
if path != expectedPath {
|
| 65 | 65 |
return nil, fmt.Errorf("path not set in URL query properly")
|
| 66 | 66 |
} |
| 67 |
- content, err := json.Marshal(types.ContainerPathStat{
|
|
| 67 |
+ content, err := json.Marshal(container.PathStat{
|
|
| 68 | 68 |
Name: "name", |
| 69 | 69 |
Mode: 0o700, |
| 70 | 70 |
}) |
| ... | ... |
@@ -188,7 +189,7 @@ func TestCopyFromContainerNotFoundError(t *testing.T) {
|
| 188 | 188 |
func TestCopyFromContainerEmptyResponse(t *testing.T) {
|
| 189 | 189 |
client := &Client{
|
| 190 | 190 |
client: newMockClient(func(req *http.Request) (*http.Response, error) {
|
| 191 |
- content, err := json.Marshal(types.ContainerPathStat{
|
|
| 191 |
+ content, err := json.Marshal(container.PathStat{
|
|
| 192 | 192 |
Name: "path/to/file", |
| 193 | 193 |
Mode: 0o700, |
| 194 | 194 |
}) |
| ... | ... |
@@ -242,7 +243,7 @@ func TestCopyFromContainer(t *testing.T) {
|
| 242 | 242 |
return nil, fmt.Errorf("path not set in URL query properly, expected '%s', got %s", expectedPath, path)
|
| 243 | 243 |
} |
| 244 | 244 |
|
| 245 |
- headercontent, err := json.Marshal(types.ContainerPathStat{
|
|
| 245 |
+ headercontent, err := json.Marshal(container.PathStat{
|
|
| 246 | 246 |
Name: "name", |
| 247 | 247 |
Mode: 0o700, |
| 248 | 248 |
}) |
| ... | ... |
@@ -66,7 +66,7 @@ type ContainerAPIClient interface {
|
| 66 | 66 |
ContainerRename(ctx context.Context, container, newContainerName string) error |
| 67 | 67 |
ContainerResize(ctx context.Context, container string, options container.ResizeOptions) error |
| 68 | 68 |
ContainerRestart(ctx context.Context, container string, options container.StopOptions) error |
| 69 |
- ContainerStatPath(ctx context.Context, container, path string) (types.ContainerPathStat, error) |
|
| 69 |
+ ContainerStatPath(ctx context.Context, container, path string) (container.PathStat, error) |
|
| 70 | 70 |
ContainerStats(ctx context.Context, container string, stream bool) (types.ContainerStats, error) |
| 71 | 71 |
ContainerStatsOneShot(ctx context.Context, container string) (types.ContainerStats, error) |
| 72 | 72 |
ContainerStart(ctx context.Context, container string, options container.StartOptions) error |
| ... | ... |
@@ -75,7 +75,7 @@ type ContainerAPIClient interface {
|
| 75 | 75 |
ContainerUnpause(ctx context.Context, container string) error |
| 76 | 76 |
ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error) |
| 77 | 77 |
ContainerWait(ctx context.Context, container string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error) |
| 78 |
- CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) |
|
| 78 |
+ CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, container.PathStat, error) |
|
| 79 | 79 |
CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error |
| 80 | 80 |
ContainersPrune(ctx context.Context, pruneFilters filters.Args) (container.PruneReport, error) |
| 81 | 81 |
} |
| ... | ... |
@@ -4,7 +4,7 @@ import ( |
| 4 | 4 |
"os" |
| 5 | 5 |
"path/filepath" |
| 6 | 6 |
|
| 7 |
- "github.com/docker/docker/api/types" |
|
| 7 |
+ containertypes "github.com/docker/docker/api/types/container" |
|
| 8 | 8 |
"github.com/docker/docker/pkg/archive" |
| 9 | 9 |
"github.com/pkg/errors" |
| 10 | 10 |
) |
| ... | ... |
@@ -45,7 +45,7 @@ func (container *Container) ResolvePath(path string) (resolvedPath, absPath stri |
| 45 | 45 |
// be acquired before calling this method and the given path should be fully |
| 46 | 46 |
// resolved to a path on the host corresponding to the given absolute path |
| 47 | 47 |
// inside the container. |
| 48 |
-func (container *Container) StatPath(resolvedPath, absPath string) (stat *types.ContainerPathStat, err error) {
|
|
| 48 |
+func (container *Container) StatPath(resolvedPath, absPath string) (stat *containertypes.PathStat, err error) {
|
|
| 49 | 49 |
if container.BaseFS == "" {
|
| 50 | 50 |
return nil, errors.New("StatPath: BaseFS of container " + container.ID + " is unexpectedly empty")
|
| 51 | 51 |
} |
| ... | ... |
@@ -72,7 +72,7 @@ func (container *Container) StatPath(resolvedPath, absPath string) (stat *types. |
| 72 | 72 |
linkTarget = filepath.Join(string(filepath.Separator), linkTarget) |
| 73 | 73 |
} |
| 74 | 74 |
|
| 75 |
- return &types.ContainerPathStat{
|
|
| 75 |
+ return &containertypes.PathStat{
|
|
| 76 | 76 |
Name: filepath.Base(absPath), |
| 77 | 77 |
Size: lstat.Size(), |
| 78 | 78 |
Mode: lstat.Mode(), |
| ... | ... |
@@ -4,13 +4,13 @@ import ( |
| 4 | 4 |
"io" |
| 5 | 5 |
"os" |
| 6 | 6 |
|
| 7 |
- "github.com/docker/docker/api/types" |
|
| 7 |
+ "github.com/docker/docker/api/types/container" |
|
| 8 | 8 |
"github.com/docker/docker/errdefs" |
| 9 | 9 |
) |
| 10 | 10 |
|
| 11 | 11 |
// ContainerStatPath stats the filesystem resource at the specified path in the |
| 12 | 12 |
// container identified by the given name. |
| 13 |
-func (daemon *Daemon) ContainerStatPath(name string, path string) (stat *types.ContainerPathStat, err error) {
|
|
| 13 |
+func (daemon *Daemon) ContainerStatPath(name string, path string) (stat *container.PathStat, err error) {
|
|
| 14 | 14 |
ctr, err := daemon.GetContainer(name) |
| 15 | 15 |
if err != nil {
|
| 16 | 16 |
return nil, err |
| ... | ... |
@@ -30,7 +30,7 @@ func (daemon *Daemon) ContainerStatPath(name string, path string) (stat *types.C |
| 30 | 30 |
// ContainerArchivePath creates an archive of the filesystem resource at the |
| 31 | 31 |
// specified path in the container identified by the given name. Returns a |
| 32 | 32 |
// tar archive of the resource and whether it was a directory or a single file. |
| 33 |
-func (daemon *Daemon) ContainerArchivePath(name string, path string) (content io.ReadCloser, stat *types.ContainerPathStat, err error) {
|
|
| 33 |
+func (daemon *Daemon) ContainerArchivePath(name string, path string) (content io.ReadCloser, stat *container.PathStat, err error) {
|
|
| 34 | 34 |
ctr, err := daemon.GetContainer(name) |
| 35 | 35 |
if err != nil {
|
| 36 | 36 |
return nil, nil, err |
| ... | ... |
@@ -8,7 +8,7 @@ import ( |
| 8 | 8 |
"os" |
| 9 | 9 |
"path/filepath" |
| 10 | 10 |
|
| 11 |
- "github.com/docker/docker/api/types" |
|
| 11 |
+ containertypes "github.com/docker/docker/api/types/container" |
|
| 12 | 12 |
"github.com/docker/docker/api/types/events" |
| 13 | 13 |
"github.com/docker/docker/container" |
| 14 | 14 |
"github.com/docker/docker/errdefs" |
| ... | ... |
@@ -20,7 +20,7 @@ import ( |
| 20 | 20 |
|
| 21 | 21 |
// containerStatPath stats the filesystem resource at the specified path in this |
| 22 | 22 |
// container. Returns stat info about the resource. |
| 23 |
-func (daemon *Daemon) containerStatPath(container *container.Container, path string) (stat *types.ContainerPathStat, err error) {
|
|
| 23 |
+func (daemon *Daemon) containerStatPath(container *container.Container, path string) (stat *containertypes.PathStat, err error) {
|
|
| 24 | 24 |
container.Lock() |
| 25 | 25 |
defer container.Unlock() |
| 26 | 26 |
|
| ... | ... |
@@ -36,7 +36,7 @@ func (daemon *Daemon) containerStatPath(container *container.Container, path str |
| 36 | 36 |
// containerArchivePath creates an archive of the filesystem resource at the specified |
| 37 | 37 |
// path in this container. Returns a tar archive of the resource and stat info |
| 38 | 38 |
// about the resource. |
| 39 |
-func (daemon *Daemon) containerArchivePath(container *container.Container, path string) (content io.ReadCloser, stat *types.ContainerPathStat, err error) {
|
|
| 39 |
+func (daemon *Daemon) containerArchivePath(container *container.Container, path string) (content io.ReadCloser, stat *containertypes.PathStat, err error) {
|
|
| 40 | 40 |
container.Lock() |
| 41 | 41 |
|
| 42 | 42 |
defer func() {
|
| ... | ... |
@@ -7,7 +7,6 @@ import ( |
| 7 | 7 |
"path/filepath" |
| 8 | 8 |
"strings" |
| 9 | 9 |
|
| 10 |
- "github.com/docker/docker/api/types" |
|
| 11 | 10 |
containertypes "github.com/docker/docker/api/types/container" |
| 12 | 11 |
"github.com/docker/docker/api/types/events" |
| 13 | 12 |
"github.com/docker/docker/container" |
| ... | ... |
@@ -19,7 +18,7 @@ import ( |
| 19 | 19 |
|
| 20 | 20 |
// containerStatPath stats the filesystem resource at the specified path in this |
| 21 | 21 |
// container. Returns stat info about the resource. |
| 22 |
-func (daemon *Daemon) containerStatPath(container *container.Container, path string) (stat *types.ContainerPathStat, err error) {
|
|
| 22 |
+func (daemon *Daemon) containerStatPath(container *container.Container, path string) (stat *containertypes.PathStat, err error) {
|
|
| 23 | 23 |
container.Lock() |
| 24 | 24 |
defer container.Unlock() |
| 25 | 25 |
|
| ... | ... |
@@ -53,7 +52,7 @@ func (daemon *Daemon) containerStatPath(container *container.Container, path str |
| 53 | 53 |
// containerArchivePath creates an archive of the filesystem resource at the specified |
| 54 | 54 |
// path in this container. Returns a tar archive of the resource and stat info |
| 55 | 55 |
// about the resource. |
| 56 |
-func (daemon *Daemon) containerArchivePath(container *container.Container, path string) (content io.ReadCloser, stat *types.ContainerPathStat, err error) {
|
|
| 56 |
+func (daemon *Daemon) containerArchivePath(container *container.Container, path string) (content io.ReadCloser, stat *containertypes.PathStat, err error) {
|
|
| 57 | 57 |
container.Lock() |
| 58 | 58 |
|
| 59 | 59 |
defer func() {
|
| ... | ... |
@@ -15,7 +15,7 @@ import ( |
| 15 | 15 |
"github.com/moby/sys/symlink" |
| 16 | 16 |
"golang.org/x/sys/unix" |
| 17 | 17 |
|
| 18 |
- "github.com/docker/docker/api/types" |
|
| 18 |
+ containertypes "github.com/docker/docker/api/types/container" |
|
| 19 | 19 |
"github.com/docker/docker/container" |
| 20 | 20 |
"github.com/docker/docker/internal/compatcontext" |
| 21 | 21 |
"github.com/docker/docker/internal/mounttree" |
| ... | ... |
@@ -54,19 +54,19 @@ type containerFSView struct {
|
| 54 | 54 |
} |
| 55 | 55 |
|
| 56 | 56 |
// openContainerFS opens a new view of the container's filesystem. |
| 57 |
-func (daemon *Daemon) openContainerFS(container *container.Container) (_ *containerFSView, err error) {
|
|
| 57 |
+func (daemon *Daemon) openContainerFS(ctr *container.Container) (_ *containerFSView, err error) {
|
|
| 58 | 58 |
ctx := context.TODO() |
| 59 | 59 |
|
| 60 |
- if err := daemon.Mount(container); err != nil {
|
|
| 60 |
+ if err := daemon.Mount(ctr); err != nil {
|
|
| 61 | 61 |
return nil, err |
| 62 | 62 |
} |
| 63 | 63 |
defer func() {
|
| 64 | 64 |
if err != nil {
|
| 65 |
- _ = daemon.Unmount(container) |
|
| 65 |
+ _ = daemon.Unmount(ctr) |
|
| 66 | 66 |
} |
| 67 | 67 |
}() |
| 68 | 68 |
|
| 69 |
- mounts, cleanup, err := daemon.setupMounts(ctx, container) |
|
| 69 |
+ mounts, cleanup, err := daemon.setupMounts(ctx, ctr) |
|
| 70 | 70 |
if err != nil {
|
| 71 | 71 |
return nil, err |
| 72 | 72 |
} |
| ... | ... |
@@ -74,7 +74,7 @@ func (daemon *Daemon) openContainerFS(container *container.Container) (_ *contai |
| 74 | 74 |
ctx := compatcontext.WithoutCancel(ctx) |
| 75 | 75 |
cleanup(ctx) |
| 76 | 76 |
if err != nil {
|
| 77 |
- _ = container.UnmountVolumes(ctx, daemon.LogVolumeEvent) |
|
| 77 |
+ _ = ctr.UnmountVolumes(ctx, daemon.LogVolumeEvent) |
|
| 78 | 78 |
} |
| 79 | 79 |
}() |
| 80 | 80 |
|
| ... | ... |
@@ -89,7 +89,7 @@ func (daemon *Daemon) openContainerFS(container *container.Container) (_ *contai |
| 89 | 89 |
return err |
| 90 | 90 |
} |
| 91 | 91 |
for _, m := range mounts {
|
| 92 |
- dest, err := container.GetResourcePath(m.Destination) |
|
| 92 |
+ dest, err := ctr.GetResourcePath(m.Destination) |
|
| 93 | 93 |
if err != nil {
|
| 94 | 94 |
return err |
| 95 | 95 |
} |
| ... | ... |
@@ -147,7 +147,7 @@ func (daemon *Daemon) openContainerFS(container *container.Container) (_ *contai |
| 147 | 147 |
} |
| 148 | 148 |
} |
| 149 | 149 |
|
| 150 |
- return mounttree.SwitchRoot(container.BaseFS) |
|
| 150 |
+ return mounttree.SwitchRoot(ctr.BaseFS) |
|
| 151 | 151 |
}, |
| 152 | 152 |
func() {
|
| 153 | 153 |
defer close(done) |
| ... | ... |
@@ -168,7 +168,7 @@ func (daemon *Daemon) openContainerFS(container *container.Container) (_ *contai |
| 168 | 168 |
} |
| 169 | 169 |
vw := &containerFSView{
|
| 170 | 170 |
d: daemon, |
| 171 |
- ctr: container, |
|
| 171 |
+ ctr: ctr, |
|
| 172 | 172 |
todo: todo, |
| 173 | 173 |
done: done, |
| 174 | 174 |
} |
| ... | ... |
@@ -219,8 +219,8 @@ func (vw *containerFSView) Close() error {
|
| 219 | 219 |
|
| 220 | 220 |
// Stat returns the metadata for path, relative to the current working directory |
| 221 | 221 |
// of vw inside the container filesystem view. |
| 222 |
-func (vw *containerFSView) Stat(ctx context.Context, path string) (*types.ContainerPathStat, error) {
|
|
| 223 |
- var stat *types.ContainerPathStat |
|
| 222 |
+func (vw *containerFSView) Stat(ctx context.Context, path string) (*containertypes.PathStat, error) {
|
|
| 223 |
+ var stat *containertypes.PathStat |
|
| 224 | 224 |
err := vw.RunInFS(ctx, func() error {
|
| 225 | 225 |
lstat, err := os.Lstat(path) |
| 226 | 226 |
if err != nil {
|
| ... | ... |
@@ -235,7 +235,7 @@ func (vw *containerFSView) Stat(ctx context.Context, path string) (*types.Contai |
| 235 | 235 |
return err |
| 236 | 236 |
} |
| 237 | 237 |
} |
| 238 |
- stat = &types.ContainerPathStat{
|
|
| 238 |
+ stat = &containertypes.PathStat{
|
|
| 239 | 239 |
Name: filepath.Base(path), |
| 240 | 240 |
Size: lstat.Size(), |
| 241 | 241 |
Mode: lstat.Mode(), |