snapshot: fix specification of Commit

The default implementations remove the key after Commit.
However, the specification had required implementations not to remove
the key.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2017-11-14 02:26:22 +00:00
parent 17093c2f6a
commit 5e8218a63b
2 changed files with 11 additions and 3 deletions

View File

@@ -143,6 +143,11 @@ func checkSnapshotterBasic(ctx context.Context, t *testing.T, snapshotter snapsh
assert.Equal(t, "", si.Parent)
assert.Equal(t, snapshot.KindCommitted, si.Kind)
_, err = snapshotter.Stat(ctx, preparing)
if err == nil {
t.Fatalf("%s should no longer be available after Commit", preparing)
}
next := filepath.Join(work, "nextlayer")
if err := os.MkdirAll(next, 0777); err != nil {
t.Fatalf("failure reason: %+v", err)
@@ -186,6 +191,11 @@ func checkSnapshotterBasic(ctx context.Context, t *testing.T, snapshotter snapsh
assert.Equal(t, committed, si2.Parent)
assert.Equal(t, snapshot.KindCommitted, si2.Kind)
_, err = snapshotter.Stat(ctx, next)
if err == nil {
t.Fatalf("%s should no longer be available after Commit", next)
}
expected := map[string]snapshot.Info{
si.Name: si,
si2.Name: si2,