snapshot: add Close()
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
@@ -370,3 +370,8 @@ func (b *snapshotter) Remove(ctx context.Context, key string) (err error) {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Close closes the snapshotter
|
||||
func (b *snapshotter) Close() error {
|
||||
return b.ms.Close()
|
||||
}
|
||||
|
||||
@@ -47,6 +47,9 @@ func boltSnapshotter(t *testing.T) func(context.Context, string) (snapshot.Snaps
|
||||
}
|
||||
|
||||
return snapshotter, func() error {
|
||||
if err := snapshotter.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
err := mount.UnmountAll(root, unix.MNT_DETACH)
|
||||
if cerr := cleanupDevice(); cerr != nil {
|
||||
err = errors.Wrap(cerr, "device cleanup failed")
|
||||
|
||||
Reference in New Issue
Block a user