snapshot/devmapper: use losetup in mount package

No need to use the private losetup command line wrapper package.
The generic package provides the same functionality.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
Peng Tao
2020-04-14 00:37:54 -07:00
committed by Maksym Pavlenko
parent 9e42070169
commit b7026236f4
5 changed files with 8 additions and 229 deletions

View File

@@ -31,7 +31,6 @@ import (
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/pkg/testutil"
"github.com/containerd/containerd/snapshots/devmapper/dmsetup"
"github.com/containerd/containerd/snapshots/devmapper/losetup"
"github.com/docker/go-units"
"github.com/sirupsen/logrus"
"gotest.tools/v3/assert"
@@ -74,7 +73,7 @@ func TestPoolDevice(t *testing.T) {
defer func() {
// Detach loop devices and remove images
err := losetup.DetachLoopDevice(loopDataDevice, loopMetaDevice)
err := mount.DetachLoopDevice(loopDataDevice, loopMetaDevice)
assert.NilError(t, err)
err = os.RemoveAll(tempDir)
@@ -306,7 +305,7 @@ func createLoopbackDevice(t *testing.T, dir string) (string, string) {
imagePath := file.Name()
loopDevice, err := losetup.AttachLoopDevice(imagePath)
loopDevice, err := mount.AttachLoopDevice(imagePath)
assert.NilError(t, err)
return imagePath, loopDevice