enable native (formerly naive) snapshotter by default

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2018-04-02 13:29:19 +09:00
parent bf5112e8ec
commit 83e35b3d3a
7 changed files with 19 additions and 18 deletions

View File

@@ -39,7 +39,7 @@ import (
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/snapshots"
"github.com/containerd/containerd/snapshots/naive"
"github.com/containerd/containerd/snapshots/native"
"github.com/gogo/protobuf/types"
digest "github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
@@ -55,7 +55,7 @@ func testDB(t *testing.T) (context.Context, *DB, func()) {
t.Fatal(err)
}
snapshotter, err := naive.NewSnapshotter(filepath.Join(dirname, "naive"))
snapshotter, err := native.NewSnapshotter(filepath.Join(dirname, "native"))
if err != nil {
t.Fatal(err)
}
@@ -70,7 +70,7 @@ func testDB(t *testing.T) (context.Context, *DB, func()) {
t.Fatal(err)
}
db := NewDB(bdb, cs, map[string]snapshots.Snapshotter{"naive": snapshotter})
db := NewDB(bdb, cs, map[string]snapshots.Snapshotter{"native": snapshotter})
if err := db.Init(ctx); err != nil {
t.Fatal(err)
}
@@ -544,7 +544,7 @@ func create(obj object, tx *bolt.Tx, is images.Store, cs content.Store, sn snaps
node = &gc.Node{
Type: ResourceSnapshot,
Namespace: namespace,
Key: fmt.Sprintf("naive/%s", v.key),
Key: fmt.Sprintf("native/%s", v.key),
}
}
case testImage:
@@ -563,7 +563,7 @@ func create(obj object, tx *bolt.Tx, is images.Store, cs content.Store, sn snaps
container := containers.Container{
ID: v.id,
SnapshotKey: v.snapshot,
Snapshotter: "naive",
Snapshotter: "native",
Labels: obj.labels,
Runtime: containers.RuntimeInfo{
@@ -658,7 +658,7 @@ func newStores(t testing.TB) (*DB, content.Store, snapshots.Snapshotter, func())
t.Fatal(err)
}
nsn, err := naive.NewSnapshotter(filepath.Join(td, "snapshots"))
nsn, err := native.NewSnapshotter(filepath.Join(td, "snapshots"))
if err != nil {
t.Fatal(err)
}
@@ -668,9 +668,9 @@ func newStores(t testing.TB) (*DB, content.Store, snapshots.Snapshotter, func())
t.Fatal(err)
}
mdb := NewDB(db, lcs, map[string]snapshots.Snapshotter{"naive": nsn})
mdb := NewDB(db, lcs, map[string]snapshots.Snapshotter{"native": nsn})
return mdb, mdb.ContentStore(), mdb.Snapshotter("naive"), func() {
return mdb, mdb.ContentStore(), mdb.Snapshotter("native"), func() {
os.RemoveAll(td)
}
}