snapshot: add Close()

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2017-11-07 08:26:56 +00:00
parent 17093c2f6a
commit 4feb6f228a
13 changed files with 66 additions and 2 deletions

View File

@@ -401,3 +401,8 @@ func (o *snapshotter) upperPath(id string) string {
func (o *snapshotter) workPath(id string) string {
return filepath.Join(o.root, "snapshots", id, "work")
}
// Close closes the snapshotter
func (o *snapshotter) Close() error {
return o.ms.Close()
}

View File

@@ -24,7 +24,7 @@ func newSnapshotter(ctx context.Context, root string) (snapshot.Snapshotter, fun
return nil, nil, err
}
return snapshotter, nil, nil
return snapshotter, func() error { return snapshotter.Close() }, nil
}
func TestOverlay(t *testing.T) {