Signed-off-by: Cory Snider <csnider@mirantis.com>
| ... | ... |
@@ -14,7 +14,6 @@ import ( |
| 14 | 14 |
containerpkg "github.com/docker/docker/container" |
| 15 | 15 |
"github.com/docker/docker/image" |
| 16 | 16 |
"github.com/docker/docker/layer" |
| 17 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 18 | 17 |
) |
| 19 | 18 |
|
| 20 | 19 |
const ( |
| ... | ... |
@@ -26,7 +25,7 @@ const ( |
| 26 | 26 |
// instructions in the builder. |
| 27 | 27 |
type Source interface {
|
| 28 | 28 |
// Root returns root path for accessing source |
| 29 |
- Root() containerfs.ContainerFS |
|
| 29 |
+ Root() string |
|
| 30 | 30 |
// Close allows to signal that the filesystem tree won't be used anymore. |
| 31 | 31 |
// For Context implementations using a temporary directory, it is recommended to |
| 32 | 32 |
// delete the temporary directory in Close(). |
| ... | ... |
@@ -110,6 +109,6 @@ type ROLayer interface {
|
| 110 | 110 |
// RWLayer is active layer that can be read/modified |
| 111 | 111 |
type RWLayer interface {
|
| 112 | 112 |
Release() error |
| 113 |
- Root() containerfs.ContainerFS |
|
| 113 |
+ Root() string |
|
| 114 | 114 |
Commit() (ROLayer, error) |
| 115 | 115 |
} |
| ... | ... |
@@ -38,7 +38,7 @@ type pathCache interface {
|
| 38 | 38 |
// copyInfo is a data object which stores the metadata about each source file in |
| 39 | 39 |
// a copyInstruction |
| 40 | 40 |
type copyInfo struct {
|
| 41 |
- root containerfs.ContainerFS |
|
| 41 |
+ root string |
|
| 42 | 42 |
path string |
| 43 | 43 |
hash string |
| 44 | 44 |
noDecompress bool |
| ... | ... |
@@ -14,7 +14,6 @@ import ( |
| 14 | 14 |
"github.com/docker/docker/image" |
| 15 | 15 |
"github.com/docker/docker/layer" |
| 16 | 16 |
"github.com/docker/docker/pkg/archive" |
| 17 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 18 | 17 |
"github.com/docker/go-connections/nat" |
| 19 | 18 |
"github.com/opencontainers/go-digest" |
| 20 | 19 |
"gotest.tools/v3/assert" |
| ... | ... |
@@ -183,8 +182,8 @@ func TestDeepCopyRunConfig(t *testing.T) {
|
| 183 | 183 |
|
| 184 | 184 |
type MockRWLayer struct{}
|
| 185 | 185 |
|
| 186 |
-func (l *MockRWLayer) Release() error { return nil }
|
|
| 187 |
-func (l *MockRWLayer) Root() containerfs.ContainerFS { return "" }
|
|
| 186 |
+func (l *MockRWLayer) Release() error { return nil }
|
|
| 187 |
+func (l *MockRWLayer) Root() string { return "" }
|
|
| 188 | 188 |
func (l *MockRWLayer) Commit() (builder.ROLayer, error) {
|
| 189 | 189 |
return &MockROLayer{
|
| 190 | 190 |
diffID: layer.DiffID(digest.Digest("sha256:1234")),
|
| ... | ... |
@@ -13,7 +13,6 @@ import ( |
| 13 | 13 |
containerpkg "github.com/docker/docker/container" |
| 14 | 14 |
"github.com/docker/docker/image" |
| 15 | 15 |
"github.com/docker/docker/layer" |
| 16 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 17 | 16 |
) |
| 18 | 17 |
|
| 19 | 18 |
// MockBackend implements the builder.Backend interface for unit testing |
| ... | ... |
@@ -143,6 +142,6 @@ func (l *mockRWLayer) Commit() (builder.ROLayer, error) {
|
| 143 | 143 |
return nil, nil |
| 144 | 144 |
} |
| 145 | 145 |
|
| 146 |
-func (l *mockRWLayer) Root() containerfs.ContainerFS {
|
|
| 146 |
+func (l *mockRWLayer) Root() string {
|
|
| 147 | 147 |
return "" |
| 148 | 148 |
} |
| ... | ... |
@@ -15,7 +15,7 @@ import ( |
| 15 | 15 |
) |
| 16 | 16 |
|
| 17 | 17 |
type archiveContext struct {
|
| 18 |
- root containerfs.ContainerFS |
|
| 18 |
+ root string |
|
| 19 | 19 |
sums tarsum.FileInfoSums |
| 20 | 20 |
} |
| 21 | 21 |
|
| ... | ... |
@@ -82,7 +82,7 @@ func FromArchive(tarStream io.Reader) (builder.Source, error) {
|
| 82 | 82 |
return tsc, nil |
| 83 | 83 |
} |
| 84 | 84 |
|
| 85 |
-func (c *archiveContext) Root() containerfs.ContainerFS {
|
|
| 85 |
+func (c *archiveContext) Root() string {
|
|
| 86 | 86 |
return c.root |
| 87 | 87 |
} |
| 88 | 88 |
|
| ... | ... |
@@ -115,7 +115,7 @@ func (c *archiveContext) Hash(path string) (string, error) {
|
| 115 | 115 |
return path, nil // backwards compat TODO: see if really needed |
| 116 | 116 |
} |
| 117 | 117 |
|
| 118 |
-func normalize(path string, root containerfs.ContainerFS) (cleanPath, fullPath string, err error) {
|
|
| 118 |
+func normalize(path string, root string) (cleanPath, fullPath string, err error) {
|
|
| 119 | 119 |
cleanPath = filepath.Clean(string(filepath.Separator) + path)[1:] |
| 120 | 120 |
fullPath, err = containerfs.ResolveScopedPath(root, path) |
| 121 | 121 |
if err != nil {
|
| ... | ... |
@@ -9,7 +9,6 @@ import ( |
| 9 | 9 |
"testing" |
| 10 | 10 |
|
| 11 | 11 |
"github.com/docker/docker/builder" |
| 12 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 13 | 12 |
) |
| 14 | 13 |
|
| 15 | 14 |
const ( |
| ... | ... |
@@ -105,14 +104,14 @@ func TestProcessShouldLeaveAllFiles(t *testing.T) {
|
| 105 | 105 |
|
| 106 | 106 |
// TODO: remove after moving to a separate pkg |
| 107 | 107 |
type stubRemote struct {
|
| 108 |
- root containerfs.ContainerFS |
|
| 108 |
+ root string |
|
| 109 | 109 |
} |
| 110 | 110 |
|
| 111 | 111 |
func (r *stubRemote) Hash(path string) (string, error) {
|
| 112 | 112 |
return "", errors.New("not implemented")
|
| 113 | 113 |
} |
| 114 | 114 |
|
| 115 |
-func (r *stubRemote) Root() containerfs.ContainerFS {
|
|
| 115 |
+func (r *stubRemote) Root() string {
|
|
| 116 | 116 |
return r.root |
| 117 | 117 |
} |
| 118 | 118 |
func (r *stubRemote) Close() error {
|
| ... | ... |
@@ -8,7 +8,6 @@ import ( |
| 8 | 8 |
"strings" |
| 9 | 9 |
|
| 10 | 10 |
"github.com/docker/docker/builder" |
| 11 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 12 | 11 |
"github.com/docker/docker/pkg/pools" |
| 13 | 12 |
"github.com/pkg/errors" |
| 14 | 13 |
) |
| ... | ... |
@@ -16,7 +15,7 @@ import ( |
| 16 | 16 |
// NewLazySource creates a new LazyContext. LazyContext defines a hashed build |
| 17 | 17 |
// context based on a root directory. Individual files are hashed first time |
| 18 | 18 |
// they are asked. It is not safe to call methods of LazyContext concurrently. |
| 19 |
-func NewLazySource(root containerfs.ContainerFS) (builder.Source, error) {
|
|
| 19 |
+func NewLazySource(root string) (builder.Source, error) {
|
|
| 20 | 20 |
return &lazySource{
|
| 21 | 21 |
root: root, |
| 22 | 22 |
sums: make(map[string]string), |
| ... | ... |
@@ -24,11 +23,11 @@ func NewLazySource(root containerfs.ContainerFS) (builder.Source, error) {
|
| 24 | 24 |
} |
| 25 | 25 |
|
| 26 | 26 |
type lazySource struct {
|
| 27 |
- root containerfs.ContainerFS |
|
| 27 |
+ root string |
|
| 28 | 28 |
sums map[string]string |
| 29 | 29 |
} |
| 30 | 30 |
|
| 31 |
-func (c *lazySource) Root() containerfs.ContainerFS {
|
|
| 31 |
+func (c *lazySource) Root() string {
|
|
| 32 | 32 |
return c.root |
| 33 | 33 |
} |
| 34 | 34 |
|
| ... | ... |
@@ -88,7 +87,7 @@ func (c *lazySource) prepareHash(relPath string, fi os.FileInfo) (string, error) |
| 88 | 88 |
|
| 89 | 89 |
// Rel makes a path relative to base path. Same as `filepath.Rel` but can also |
| 90 | 90 |
// handle UUID paths in windows. |
| 91 |
-func Rel(basepath containerfs.ContainerFS, targpath string) (string, error) {
|
|
| 91 |
+func Rel(basepath string, targpath string) (string, error) {
|
|
| 92 | 92 |
// filepath.Rel can't handle UUID paths in windows |
| 93 | 93 |
if runtime.GOOS == "windows" {
|
| 94 | 94 |
pfx := basepath + `\` |
| ... | ... |
@@ -5,7 +5,6 @@ import ( |
| 5 | 5 |
"path/filepath" |
| 6 | 6 |
"sync" |
| 7 | 7 |
|
| 8 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 9 | 8 |
iradix "github.com/hashicorp/go-immutable-radix" |
| 10 | 9 |
"github.com/opencontainers/go-digest" |
| 11 | 10 |
"github.com/pkg/errors" |
| ... | ... |
@@ -19,7 +18,7 @@ type hashed interface {
|
| 19 | 19 |
// CachableSource is a source that contains cache records for its contents |
| 20 | 20 |
type CachableSource struct {
|
| 21 | 21 |
mu sync.Mutex |
| 22 |
- root containerfs.ContainerFS |
|
| 22 |
+ root string |
|
| 23 | 23 |
tree *iradix.Tree |
| 24 | 24 |
txn *iradix.Txn |
| 25 | 25 |
} |
| ... | ... |
@@ -145,7 +144,7 @@ func (cs *CachableSource) Hash(path string) (string, error) {
|
| 145 | 145 |
} |
| 146 | 146 |
|
| 147 | 147 |
// Root returns a root directory for the source |
| 148 |
-func (cs *CachableSource) Root() containerfs.ContainerFS {
|
|
| 148 |
+func (cs *CachableSource) Root() string {
|
|
| 149 | 149 |
return cs.root |
| 150 | 150 |
} |
| 151 | 151 |
|
| ... | ... |
@@ -61,10 +61,10 @@ type ExitStatus struct {
|
| 61 | 61 |
type Container struct {
|
| 62 | 62 |
StreamConfig *stream.Config |
| 63 | 63 |
// embed for Container to support states directly. |
| 64 |
- *State `json:"State"` // Needed for Engine API version <= 1.11 |
|
| 65 |
- Root string `json:"-"` // Path to the "home" of the container, including metadata. |
|
| 66 |
- BaseFS containerfs.ContainerFS `json:"-"` // interface containing graphdriver mount |
|
| 67 |
- RWLayer layer.RWLayer `json:"-"` |
|
| 64 |
+ *State `json:"State"` // Needed for Engine API version <= 1.11 |
|
| 65 |
+ Root string `json:"-"` // Path to the "home" of the container, including metadata. |
|
| 66 |
+ BaseFS string `json:"-"` // Path to the graphdriver mountpoint |
|
| 67 |
+ RWLayer layer.RWLayer `json:"-"` |
|
| 68 | 68 |
ID string |
| 69 | 69 |
Created time.Time |
| 70 | 70 |
Managed bool |
| ... | ... |
@@ -38,7 +38,6 @@ import ( |
| 38 | 38 |
"github.com/docker/docker/libnetwork/options" |
| 39 | 39 |
lntypes "github.com/docker/docker/libnetwork/types" |
| 40 | 40 |
"github.com/docker/docker/opts" |
| 41 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 42 | 41 |
"github.com/docker/docker/pkg/idtools" |
| 43 | 42 |
"github.com/docker/docker/pkg/parsers" |
| 44 | 43 |
"github.com/docker/docker/pkg/parsers/kernel" |
| ... | ... |
@@ -1072,8 +1071,8 @@ func removeDefaultBridgeInterface() {
|
| 1072 | 1072 |
} |
| 1073 | 1073 |
} |
| 1074 | 1074 |
|
| 1075 |
-func setupInitLayer(idMapping idtools.IdentityMapping) func(containerfs.ContainerFS) error {
|
|
| 1076 |
- return func(initPath containerfs.ContainerFS) error {
|
|
| 1075 |
+func setupInitLayer(idMapping idtools.IdentityMapping) func(string) error {
|
|
| 1076 |
+ return func(initPath string) error {
|
|
| 1077 | 1077 |
return initlayer.Setup(initPath, idMapping.RootPair()) |
| 1078 | 1078 |
} |
| 1079 | 1079 |
} |
| ... | ... |
@@ -23,7 +23,6 @@ import ( |
| 23 | 23 |
winlibnetwork "github.com/docker/docker/libnetwork/drivers/windows" |
| 24 | 24 |
"github.com/docker/docker/libnetwork/netlabel" |
| 25 | 25 |
"github.com/docker/docker/libnetwork/options" |
| 26 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 27 | 26 |
"github.com/docker/docker/pkg/idtools" |
| 28 | 27 |
"github.com/docker/docker/pkg/parsers" |
| 29 | 28 |
"github.com/docker/docker/pkg/parsers/operatingsystem" |
| ... | ... |
@@ -64,7 +63,7 @@ func (daemon *Daemon) parseSecurityOpt(container *container.Container, hostConfi |
| 64 | 64 |
return nil |
| 65 | 65 |
} |
| 66 | 66 |
|
| 67 |
-func setupInitLayer(idMapping idtools.IdentityMapping) func(containerfs.ContainerFS) error {
|
|
| 67 |
+func setupInitLayer(idMapping idtools.IdentityMapping) func(string) error {
|
|
| 68 | 68 |
return nil |
| 69 | 69 |
} |
| 70 | 70 |
|
| ... | ... |
@@ -351,7 +351,7 @@ func atomicRemove(source string) error {
|
| 351 | 351 |
|
| 352 | 352 |
// Get returns the rootfs path for the id. |
| 353 | 353 |
// This will mount the dir at its given path |
| 354 |
-func (a *Driver) Get(id, mountLabel string) (containerfs.ContainerFS, error) {
|
|
| 354 |
+func (a *Driver) Get(id, mountLabel string) (string, error) {
|
|
| 355 | 355 |
a.locker.Lock(id) |
| 356 | 356 |
defer a.locker.Unlock(id) |
| 357 | 357 |
parents, err := a.getParentLayerPaths(id) |
| ... | ... |
@@ -627,7 +627,7 @@ func (d *Driver) Remove(id string) error {
|
| 627 | 627 |
} |
| 628 | 628 |
|
| 629 | 629 |
// Get the requested filesystem id. |
| 630 |
-func (d *Driver) Get(id, mountLabel string) (containerfs.ContainerFS, error) {
|
|
| 630 |
+func (d *Driver) Get(id, mountLabel string) (string, error) {
|
|
| 631 | 631 |
dir := d.subvolumesDirID(id) |
| 632 | 632 |
st, err := os.Stat(dir) |
| 633 | 633 |
if err != nil {
|
| ... | ... |
@@ -10,7 +10,6 @@ import ( |
| 10 | 10 |
"strconv" |
| 11 | 11 |
|
| 12 | 12 |
"github.com/docker/docker/daemon/graphdriver" |
| 13 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 14 | 13 |
"github.com/docker/docker/pkg/devicemapper" |
| 15 | 14 |
"github.com/docker/docker/pkg/idtools" |
| 16 | 15 |
units "github.com/docker/go-units" |
| ... | ... |
@@ -175,7 +174,7 @@ func (d *Driver) Remove(id string) error {
|
| 175 | 175 |
} |
| 176 | 176 |
|
| 177 | 177 |
// Get mounts a device with given id into the root filesystem |
| 178 |
-func (d *Driver) Get(id, mountLabel string) (containerfs.ContainerFS, error) {
|
|
| 178 |
+func (d *Driver) Get(id, mountLabel string) (string, error) {
|
|
| 179 | 179 |
d.locker.Lock(id) |
| 180 | 180 |
defer d.locker.Unlock(id) |
| 181 | 181 |
mp := path.Join(d.home, "mnt", id) |
| ... | ... |
@@ -7,7 +7,6 @@ import ( |
| 7 | 7 |
"strings" |
| 8 | 8 |
|
| 9 | 9 |
"github.com/docker/docker/pkg/archive" |
| 10 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 11 | 10 |
"github.com/docker/docker/pkg/idtools" |
| 12 | 11 |
"github.com/docker/docker/pkg/plugingetter" |
| 13 | 12 |
"github.com/pkg/errors" |
| ... | ... |
@@ -60,7 +59,7 @@ type ProtoDriver interface {
|
| 60 | 60 |
// Get returns the mountpoint for the layered filesystem referred |
| 61 | 61 |
// to by this id. You can optionally specify a mountLabel or "". |
| 62 | 62 |
// Returns the absolute path to the mounted layered filesystem. |
| 63 |
- Get(id, mountLabel string) (fs containerfs.ContainerFS, err error) |
|
| 63 |
+ Get(id, mountLabel string) (fs string, err error) |
|
| 64 | 64 |
// Put releases the system resources for the specified id, |
| 65 | 65 |
// e.g, unmounting layered filesystem. |
| 66 | 66 |
Put(id string) error |
| ... | ... |
@@ -303,7 +303,7 @@ func (d *Driver) Remove(id string) error {
|
| 303 | 303 |
} |
| 304 | 304 |
|
| 305 | 305 |
// Get creates and mounts the required file system for the given id and returns the mount path. |
| 306 |
-func (d *Driver) Get(id, mountLabel string) (_ containerfs.ContainerFS, retErr error) {
|
|
| 306 |
+func (d *Driver) Get(id, mountLabel string) (_ string, retErr error) {
|
|
| 307 | 307 |
d.locker.Lock(id) |
| 308 | 308 |
defer d.locker.Unlock(id) |
| 309 | 309 |
dir := d.dir(id) |
| ... | ... |
@@ -339,7 +339,7 @@ func (d *Driver) Remove(id string) error {
|
| 339 | 339 |
} |
| 340 | 340 |
|
| 341 | 341 |
// Get creates and mounts the required file system for the given id and returns the mount path. |
| 342 |
-func (d *Driver) Get(id, mountLabel string) (_ containerfs.ContainerFS, err error) {
|
|
| 342 |
+func (d *Driver) Get(id, mountLabel string) (_ string, err error) {
|
|
| 343 | 343 |
d.locker.Lock(id) |
| 344 | 344 |
defer d.locker.Unlock(id) |
| 345 | 345 |
dir := d.dir(id) |
| ... | ... |
@@ -513,7 +513,7 @@ func (d *Driver) Remove(id string) error {
|
| 513 | 513 |
} |
| 514 | 514 |
|
| 515 | 515 |
// Get creates and mounts the required file system for the given id and returns the mount path. |
| 516 |
-func (d *Driver) Get(id, mountLabel string) (_ containerfs.ContainerFS, retErr error) {
|
|
| 516 |
+func (d *Driver) Get(id, mountLabel string) (_ string, retErr error) {
|
|
| 517 | 517 |
d.locker.Lock(id) |
| 518 | 518 |
defer d.locker.Unlock(id) |
| 519 | 519 |
dir := d.dir(id) |
| ... | ... |
@@ -6,7 +6,6 @@ import ( |
| 6 | 6 |
"io" |
| 7 | 7 |
|
| 8 | 8 |
"github.com/docker/docker/pkg/archive" |
| 9 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 10 | 9 |
"github.com/docker/docker/pkg/idtools" |
| 11 | 10 |
"github.com/docker/docker/pkg/plugingetter" |
| 12 | 11 |
"github.com/docker/docker/pkg/plugins" |
| ... | ... |
@@ -128,7 +127,7 @@ func (d *graphDriverProxy) Remove(id string) error {
|
| 128 | 128 |
return nil |
| 129 | 129 |
} |
| 130 | 130 |
|
| 131 |
-func (d *graphDriverProxy) Get(id, mountLabel string) (containerfs.ContainerFS, error) {
|
|
| 131 |
+func (d *graphDriverProxy) Get(id, mountLabel string) (string, error) {
|
|
| 132 | 132 |
args := &graphDriverRequest{
|
| 133 | 133 |
ID: id, |
| 134 | 134 |
MountLabel: mountLabel, |
| ... | ... |
@@ -185,7 +185,7 @@ func (d *Driver) Remove(id string) error {
|
| 185 | 185 |
} |
| 186 | 186 |
|
| 187 | 187 |
// Get returns the directory for the given id. |
| 188 |
-func (d *Driver) Get(id, mountLabel string) (containerfs.ContainerFS, error) {
|
|
| 188 |
+func (d *Driver) Get(id, mountLabel string) (string, error) {
|
|
| 189 | 189 |
dir := d.dir(id) |
| 190 | 190 |
if st, err := os.Stat(dir); err != nil {
|
| 191 | 191 |
return "", err |
| ... | ... |
@@ -27,7 +27,6 @@ import ( |
| 27 | 27 |
"github.com/Microsoft/hcsshim/osversion" |
| 28 | 28 |
"github.com/docker/docker/daemon/graphdriver" |
| 29 | 29 |
"github.com/docker/docker/pkg/archive" |
| 30 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 31 | 30 |
"github.com/docker/docker/pkg/idtools" |
| 32 | 31 |
"github.com/docker/docker/pkg/ioutils" |
| 33 | 32 |
"github.com/docker/docker/pkg/longpath" |
| ... | ... |
@@ -393,7 +392,7 @@ func (d *Driver) GetLayerPath(id string) (string, error) {
|
| 393 | 393 |
} |
| 394 | 394 |
|
| 395 | 395 |
// Get returns the rootfs path for the id. This will mount the dir at its given path. |
| 396 |
-func (d *Driver) Get(id, mountLabel string) (containerfs.ContainerFS, error) {
|
|
| 396 |
+func (d *Driver) Get(id, mountLabel string) (string, error) {
|
|
| 397 | 397 |
logrus.Debugf("WindowsGraphDriver Get() id %s mountLabel %s", id, mountLabel)
|
| 398 | 398 |
var dir string |
| 399 | 399 |
|
| ... | ... |
@@ -14,7 +14,6 @@ import ( |
| 14 | 14 |
"time" |
| 15 | 15 |
|
| 16 | 16 |
"github.com/docker/docker/daemon/graphdriver" |
| 17 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 18 | 17 |
"github.com/docker/docker/pkg/idtools" |
| 19 | 18 |
"github.com/docker/docker/pkg/parsers" |
| 20 | 19 |
zfs "github.com/mistifyio/go-zfs" |
| ... | ... |
@@ -363,7 +362,7 @@ func (d *Driver) Remove(id string) error {
|
| 363 | 363 |
} |
| 364 | 364 |
|
| 365 | 365 |
// Get returns the mountpoint for the given id after creating the target directories if necessary. |
| 366 |
-func (d *Driver) Get(id, mountLabel string) (_ containerfs.ContainerFS, retErr error) {
|
|
| 366 |
+func (d *Driver) Get(id, mountLabel string) (_ string, retErr error) {
|
|
| 367 | 367 |
d.locker.Lock(id) |
| 368 | 368 |
defer d.locker.Unlock(id) |
| 369 | 369 |
mountpoint := d.mountPath(id) |
| ... | ... |
@@ -14,7 +14,6 @@ import ( |
| 14 | 14 |
"github.com/docker/docker/errdefs" |
| 15 | 15 |
"github.com/docker/docker/image" |
| 16 | 16 |
"github.com/docker/docker/layer" |
| 17 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 18 | 17 |
"github.com/docker/docker/pkg/progress" |
| 19 | 18 |
"github.com/docker/docker/pkg/streamformatter" |
| 20 | 19 |
"github.com/docker/docker/pkg/stringid" |
| ... | ... |
@@ -83,10 +82,10 @@ type rwLayer struct {
|
| 83 | 83 |
released bool |
| 84 | 84 |
layerStore layer.Store |
| 85 | 85 |
rwLayer layer.RWLayer |
| 86 |
- fs containerfs.ContainerFS |
|
| 86 |
+ fs string |
|
| 87 | 87 |
} |
| 88 | 88 |
|
| 89 |
-func (l *rwLayer) Root() containerfs.ContainerFS {
|
|
| 89 |
+func (l *rwLayer) Root() string {
|
|
| 90 | 90 |
return l.fs |
| 91 | 91 |
} |
| 92 | 92 |
|
| ... | ... |
@@ -8,7 +8,6 @@ import ( |
| 8 | 8 |
"path/filepath" |
| 9 | 9 |
"strings" |
| 10 | 10 |
|
| 11 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 12 | 11 |
"github.com/docker/docker/pkg/idtools" |
| 13 | 12 |
"golang.org/x/sys/unix" |
| 14 | 13 |
) |
| ... | ... |
@@ -18,7 +17,7 @@ import ( |
| 18 | 18 |
// |
| 19 | 19 |
// This extra layer is used by all containers as the top-most ro layer. It protects |
| 20 | 20 |
// the container from unwanted side-effects on the rw layer. |
| 21 |
-func Setup(initLayerFs containerfs.ContainerFS, rootIdentity idtools.Identity) error {
|
|
| 21 |
+func Setup(initLayerFs string, rootIdentity idtools.Identity) error {
|
|
| 22 | 22 |
// Since all paths are local to the container, we can just extract initLayerFs.Path() |
| 23 | 23 |
initLayer := initLayerFs |
| 24 | 24 |
|
| ... | ... |
@@ -15,7 +15,6 @@ import ( |
| 15 | 15 |
|
| 16 | 16 |
"github.com/docker/distribution" |
| 17 | 17 |
"github.com/docker/docker/pkg/archive" |
| 18 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 19 | 18 |
"github.com/opencontainers/go-digest" |
| 20 | 19 |
"github.com/sirupsen/logrus" |
| 21 | 20 |
) |
| ... | ... |
@@ -114,7 +113,7 @@ type RWLayer interface {
|
| 114 | 114 |
|
| 115 | 115 |
// Mount mounts the RWLayer and returns the filesystem path |
| 116 | 116 |
// to the writable layer. |
| 117 |
- Mount(mountLabel string) (containerfs.ContainerFS, error) |
|
| 117 |
+ Mount(mountLabel string) (string, error) |
|
| 118 | 118 |
|
| 119 | 119 |
// Unmount unmounts the RWLayer. This should be called |
| 120 | 120 |
// for every mount. If there are multiple mount calls |
| ... | ... |
@@ -158,7 +157,7 @@ type Metadata struct {
|
| 158 | 158 |
// writable mount. Changes made here will |
| 159 | 159 |
// not be included in the Tar stream of the |
| 160 | 160 |
// RWLayer. |
| 161 |
-type MountInit func(root containerfs.ContainerFS) error |
|
| 161 |
+type MountInit func(root string) error |
|
| 162 | 162 |
|
| 163 | 163 |
// CreateRWLayerOpts contains optional arguments to be passed to CreateRWLayer |
| 164 | 164 |
type CreateRWLayerOpts struct {
|
| ... | ... |
@@ -13,7 +13,6 @@ import ( |
| 13 | 13 |
"github.com/docker/docker/daemon/graphdriver" |
| 14 | 14 |
"github.com/docker/docker/daemon/graphdriver/vfs" |
| 15 | 15 |
"github.com/docker/docker/pkg/archive" |
| 16 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 17 | 16 |
"github.com/docker/docker/pkg/idtools" |
| 18 | 17 |
"github.com/docker/docker/pkg/stringid" |
| 19 | 18 |
"github.com/opencontainers/go-digest" |
| ... | ... |
@@ -80,7 +79,7 @@ func newTestStore(t *testing.T) (Store, string, func()) {
|
| 80 | 80 |
} |
| 81 | 81 |
} |
| 82 | 82 |
|
| 83 |
-type layerInit func(root containerfs.ContainerFS) error |
|
| 83 |
+type layerInit func(root string) error |
|
| 84 | 84 |
|
| 85 | 85 |
func createLayer(ls Store, parent ChainID, layerFunc layerInit) (Layer, error) {
|
| 86 | 86 |
containerID := stringid.GenerateRandomID() |
| ... | ... |
@@ -121,7 +120,7 @@ func createLayer(ls Store, parent ChainID, layerFunc layerInit) (Layer, error) {
|
| 121 | 121 |
} |
| 122 | 122 |
|
| 123 | 123 |
type FileApplier interface {
|
| 124 |
- ApplyFile(root containerfs.ContainerFS) error |
|
| 124 |
+ ApplyFile(root string) error |
|
| 125 | 125 |
} |
| 126 | 126 |
|
| 127 | 127 |
type testFile struct {
|
| ... | ... |
@@ -138,7 +137,7 @@ func newTestFile(name string, content []byte, perm os.FileMode) FileApplier {
|
| 138 | 138 |
} |
| 139 | 139 |
} |
| 140 | 140 |
|
| 141 |
-func (tf *testFile) ApplyFile(root containerfs.ContainerFS) error {
|
|
| 141 |
+func (tf *testFile) ApplyFile(root string) error {
|
|
| 142 | 142 |
fullPath := filepath.Join(root, tf.name) |
| 143 | 143 |
if err := os.MkdirAll(filepath.Dir(fullPath), 0755); err != nil {
|
| 144 | 144 |
return err |
| ... | ... |
@@ -153,7 +152,7 @@ func (tf *testFile) ApplyFile(root containerfs.ContainerFS) error {
|
| 153 | 153 |
} |
| 154 | 154 |
|
| 155 | 155 |
func initWithFiles(files ...FileApplier) layerInit {
|
| 156 |
- return func(root containerfs.ContainerFS) error {
|
|
| 156 |
+ return func(root string) error {
|
|
| 157 | 157 |
for _, f := range files {
|
| 158 | 158 |
if err := f.ApplyFile(root); err != nil {
|
| 159 | 159 |
return err |
| ... | ... |
@@ -10,7 +10,6 @@ import ( |
| 10 | 10 |
|
| 11 | 11 |
"github.com/containerd/continuity/driver" |
| 12 | 12 |
"github.com/docker/docker/pkg/archive" |
| 13 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 14 | 13 |
) |
| 15 | 14 |
|
| 16 | 15 |
func TestMountInit(t *testing.T) {
|
| ... | ... |
@@ -30,7 +29,7 @@ func TestMountInit(t *testing.T) {
|
| 30 | 30 |
t.Fatal(err) |
| 31 | 31 |
} |
| 32 | 32 |
|
| 33 |
- mountInit := func(root containerfs.ContainerFS) error {
|
|
| 33 |
+ mountInit := func(root string) error {
|
|
| 34 | 34 |
return initfile.ApplyFile(root) |
| 35 | 35 |
} |
| 36 | 36 |
|
| ... | ... |
@@ -90,7 +89,7 @@ func TestMountSize(t *testing.T) {
|
| 90 | 90 |
t.Fatal(err) |
| 91 | 91 |
} |
| 92 | 92 |
|
| 93 |
- mountInit := func(root containerfs.ContainerFS) error {
|
|
| 93 |
+ mountInit := func(root string) error {
|
|
| 94 | 94 |
return newTestFile("file-init", contentInit, 0777).ApplyFile(root)
|
| 95 | 95 |
} |
| 96 | 96 |
rwLayerOpts := &CreateRWLayerOpts{
|
| ... | ... |
@@ -142,7 +141,7 @@ func TestMountChanges(t *testing.T) {
|
| 142 | 142 |
t.Fatal(err) |
| 143 | 143 |
} |
| 144 | 144 |
|
| 145 |
- mountInit := func(root containerfs.ContainerFS) error {
|
|
| 145 |
+ mountInit := func(root string) error {
|
|
| 146 | 146 |
return initfile.ApplyFile(root) |
| 147 | 147 |
} |
| 148 | 148 |
rwLayerOpts := &CreateRWLayerOpts{
|
| ... | ... |
@@ -5,7 +5,6 @@ import ( |
| 5 | 5 |
"sync" |
| 6 | 6 |
|
| 7 | 7 |
"github.com/docker/docker/pkg/archive" |
| 8 |
- "github.com/docker/docker/pkg/containerfs" |
|
| 9 | 8 |
) |
| 10 | 9 |
|
| 11 | 10 |
type mountedLayer struct {
|
| ... | ... |
@@ -100,7 +99,7 @@ type referencedRWLayer struct {
|
| 100 | 100 |
*mountedLayer |
| 101 | 101 |
} |
| 102 | 102 |
|
| 103 |
-func (rl *referencedRWLayer) Mount(mountLabel string) (containerfs.ContainerFS, error) {
|
|
| 103 |
+func (rl *referencedRWLayer) Mount(mountLabel string) (string, error) {
|
|
| 104 | 104 |
return rl.layerStore.driver.Get(rl.mountedLayer.mountID, mountLabel) |
| 105 | 105 |
} |
| 106 | 106 |
|
| ... | ... |
@@ -6,9 +6,6 @@ import ( |
| 6 | 6 |
"github.com/moby/sys/symlink" |
| 7 | 7 |
) |
| 8 | 8 |
|
| 9 |
-// ContainerFS is that represents a root file system |
|
| 10 |
-type ContainerFS = string |
|
| 11 |
- |
|
| 12 | 9 |
// ResolveScopedPath evaluates the given path scoped to the root. |
| 13 | 10 |
// For example, if root=/a, and path=/b/c, then this function would return /a/b/c. |
| 14 | 11 |
func ResolveScopedPath(root, path string) (string, error) {
|