diff --git a/devmapper/plugin.go b/devmapper/plugin.go index 5013f1a47e..67252eda38 100644 --- a/devmapper/plugin.go +++ b/devmapper/plugin.go @@ -44,7 +44,7 @@ func (b *DMBackend) Cleanup() error { 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) var parentID string if parent, err := img.Parent(); err != nil { diff --git a/devmapper/plugin_test.go b/devmapper/plugin_test.go index 08df3c3171..5f80c1dab2 100644 --- a/devmapper/plugin_test.go +++ b/devmapper/plugin_test.go @@ -2,7 +2,7 @@ package devmapper import ( "io/ioutil" - _ "os" + "os" "testing" ) @@ -42,7 +42,7 @@ func mkTestDirectory(t *testing.T) string { func TestInit(t *testing.T) { home := mkTestDirectory(t) - // defer os.RemoveAll(home) + defer os.RemoveAll(home) plugin, err := Init(home) if err != nil { t.Fatal(err) @@ -54,8 +54,8 @@ func TestInit(t *testing.T) { } }() img := mkTestImage(t) - // defer os.RemoveAll(img.(*TestImage).path) - if err := plugin.Create(img, nil); err != nil { + defer os.RemoveAll(img.(*TestImage).path) + if err := plugin.OnCreate(img, nil); err != nil { t.Fatal(err) } }