summaryrefslogtreecommitdiff
path: root/volume
diff options
context:
space:
mode:
authorKir Kolyshkin <kolyshkin@gmail.com>2020-03-13 16:38:24 -0700
committerKir Kolyshkin <kolyshkin@gmail.com>2020-03-20 09:46:25 -0700
commit39048cf6562a31a5def8111e7ecd055cdcd6c3be (patch)
tree788aeb1ae3add7852328291d62930a89787d1634 /volume
parent59c0495409a52a720dc1a5177bdd0941148ee63e (diff)
downloaddocker-39048cf6562a31a5def8111e7ecd055cdcd6c3be.tar.gz
Really switch to moby/sys/mount*
Switch to moby/sys/mount and mountinfo. Keep the pkg/mount for potential outside users. This commit was generated by the following bash script: ``` set -e -u -o pipefail for file in $(git grep -l 'docker/docker/pkg/mount"' | grep -v ^pkg/mount); do sed -i -e 's#/docker/docker/pkg/mount"#/moby/sys/mount"#' \ -e 's#mount\.\(GetMounts\|Mounted\|Info\|[A-Za-z]*Filter\)#mountinfo.\1#g' \ $file goimports -w $file done ``` Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Diffstat (limited to 'volume')
-rw-r--r--volume/local/local.go5
-rw-r--r--volume/local/local_test.go6
-rw-r--r--volume/local/local_unix.go2
3 files changed, 7 insertions, 6 deletions
diff --git a/volume/local/local.go b/volume/local/local.go
index e587814d19..17a96550c0 100644
--- a/volume/local/local.go
+++ b/volume/local/local.go
@@ -16,8 +16,9 @@ import (
"github.com/docker/docker/daemon/names"
"github.com/docker/docker/errdefs"
"github.com/docker/docker/pkg/idtools"
- "github.com/docker/docker/pkg/mount"
"github.com/docker/docker/volume"
+ "github.com/moby/sys/mount"
+ "github.com/moby/sys/mountinfo"
"github.com/pkg/errors"
)
@@ -335,7 +336,7 @@ func (v *localVolume) Unmount(id string) error {
func (v *localVolume) unmount() error {
if v.opts != nil {
if err := mount.Unmount(v.path); err != nil {
- if mounted, mErr := mount.Mounted(v.path); mounted || mErr != nil {
+ if mounted, mErr := mountinfo.Mounted(v.path); mounted || mErr != nil {
return errdefs.System(err)
}
}
diff --git a/volume/local/local_test.go b/volume/local/local_test.go
index 381787ecb1..ec5cecb6f4 100644
--- a/volume/local/local_test.go
+++ b/volume/local/local_test.go
@@ -10,7 +10,7 @@ import (
"testing"
"github.com/docker/docker/pkg/idtools"
- "github.com/docker/docker/pkg/mount"
+ "github.com/moby/sys/mountinfo"
"gotest.tools/v3/skip"
)
@@ -211,7 +211,7 @@ func TestCreateWithOpts(t *testing.T) {
}
}()
- mountInfos, err := mount.GetMounts(mount.SingleEntryFilter(dir))
+ mountInfos, err := mountinfo.GetMounts(mountinfo.SingleEntryFilter(dir))
if err != nil {
t.Fatal(err)
}
@@ -253,7 +253,7 @@ func TestCreateWithOpts(t *testing.T) {
t.Fatalf("Expected active mount count to be 1, got %d", v.active.count)
}
- mounted, err := mount.Mounted(v.path)
+ mounted, err := mountinfo.Mounted(v.path)
if err != nil {
t.Fatal(err)
}
diff --git a/volume/local/local_unix.go b/volume/local/local_unix.go
index 4ac45baf25..5af8822191 100644
--- a/volume/local/local_unix.go
+++ b/volume/local/local_unix.go
@@ -15,7 +15,7 @@ import (
"time"
"github.com/docker/docker/errdefs"
- "github.com/docker/docker/pkg/mount"
+ "github.com/moby/sys/mount"
"github.com/pkg/errors"
)