mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
devmapper: rename Create() to OnCreate(), cleanup tests
This commit is contained in:
parent
d64df7c765
commit
d2c2c2c116
2 changed files with 5 additions and 5 deletions
|
@ -44,7 +44,7 @@ func (b *DMBackend) Cleanup() error {
|
||||||
return b.DeviceSet.Shutdown()
|
return b.DeviceSet.Shutdown()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *DMBackend) Create(img Image, layer archive.Archive) error {
|
func (b *DMBackend) OnCreate(img Image, layer archive.Archive) error {
|
||||||
// Determine the source of the snapshot (parent id or init device)
|
// Determine the source of the snapshot (parent id or init device)
|
||||||
var parentID string
|
var parentID string
|
||||||
if parent, err := img.Parent(); err != nil {
|
if parent, err := img.Parent(); err != nil {
|
||||||
|
|
|
@ -2,7 +2,7 @@ package devmapper
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
_ "os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ func mkTestDirectory(t *testing.T) string {
|
||||||
|
|
||||||
func TestInit(t *testing.T) {
|
func TestInit(t *testing.T) {
|
||||||
home := mkTestDirectory(t)
|
home := mkTestDirectory(t)
|
||||||
// defer os.RemoveAll(home)
|
defer os.RemoveAll(home)
|
||||||
plugin, err := Init(home)
|
plugin, err := Init(home)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
@ -54,8 +54,8 @@ func TestInit(t *testing.T) {
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
img := mkTestImage(t)
|
img := mkTestImage(t)
|
||||||
// defer os.RemoveAll(img.(*TestImage).path)
|
defer os.RemoveAll(img.(*TestImage).path)
|
||||||
if err := plugin.Create(img, nil); err != nil {
|
if err := plugin.OnCreate(img, nil); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue