diff --git a/cmd/containerd/builtins_linux.go b/cmd/containerd/builtins_linux.go index 13e3bc3c8..cf84abe65 100644 --- a/cmd/containerd/builtins_linux.go +++ b/cmd/containerd/builtins_linux.go @@ -20,6 +20,7 @@ import ( _ "github.com/containerd/aufs" _ "github.com/containerd/containerd/linux" _ "github.com/containerd/containerd/metrics/cgroups" + _ "github.com/containerd/containerd/snapshots/native" _ "github.com/containerd/containerd/snapshots/overlay" _ "github.com/containerd/zfs" ) diff --git a/cmd/containerd/builtins_unix.go b/cmd/containerd/builtins_unix.go index fc80d1876..d593166ca 100644 --- a/cmd/containerd/builtins_unix.go +++ b/cmd/containerd/builtins_unix.go @@ -19,5 +19,5 @@ package main import ( - _ "github.com/containerd/containerd/snapshots/naive" + _ "github.com/containerd/containerd/snapshots/native" ) diff --git a/metadata/db_test.go b/metadata/db_test.go index dedc1dd3f..c1889c089 100644 --- a/metadata/db_test.go +++ b/metadata/db_test.go @@ -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) } } diff --git a/metadata/snapshot_test.go b/metadata/snapshot_test.go index eebe5b956..e7bedbd55 100644 --- a/metadata/snapshot_test.go +++ b/metadata/snapshot_test.go @@ -25,17 +25,17 @@ import ( "github.com/boltdb/bolt" "github.com/containerd/containerd/snapshots" - "github.com/containerd/containerd/snapshots/naive" + "github.com/containerd/containerd/snapshots/native" "github.com/containerd/containerd/snapshots/testsuite" "github.com/containerd/containerd/testutil" ) func newTestSnapshotter(ctx context.Context, root string) (snapshots.Snapshotter, func() error, error) { - naiveRoot := filepath.Join(root, "naive") - if err := os.Mkdir(naiveRoot, 0770); err != nil { + nativeRoot := filepath.Join(root, "native") + if err := os.Mkdir(nativeRoot, 0770); err != nil { return nil, nil, err } - snapshotter, err := naive.NewSnapshotter(naiveRoot) + snapshotter, err := native.NewSnapshotter(nativeRoot) if err != nil { return nil, nil, err } @@ -45,7 +45,7 @@ func newTestSnapshotter(ctx context.Context, root string) (snapshots.Snapshotter return nil, nil, err } - sn := NewDB(db, nil, map[string]snapshots.Snapshotter{"naive": snapshotter}).Snapshotter("naive") + sn := NewDB(db, nil, map[string]snapshots.Snapshotter{"native": snapshotter}).Snapshotter("native") return sn, func() error { if err := sn.Close(); err != nil { diff --git a/snapshots/naive/naive.go b/snapshots/native/native.go similarity index 99% rename from snapshots/naive/naive.go rename to snapshots/native/native.go index 42c847cfc..3794a53e1 100644 --- a/snapshots/naive/naive.go +++ b/snapshots/native/native.go @@ -14,7 +14,7 @@ limitations under the License. */ -package naive +package native import ( "context" @@ -35,7 +35,7 @@ import ( func init() { plugin.Register(&plugin.Registration{ Type: plugin.SnapshotPlugin, - ID: "naive", + ID: "native", InitFn: func(ic *plugin.InitContext) (interface{}, error) { ic.Meta.Platforms = append(ic.Meta.Platforms, platforms.DefaultSpec()) return NewSnapshotter(ic.Root) diff --git a/snapshots/naive/naive_test.go b/snapshots/native/native_test.go similarity index 98% rename from snapshots/naive/naive_test.go rename to snapshots/native/native_test.go index d0a12fe61..b49072fd1 100644 --- a/snapshots/naive/naive_test.go +++ b/snapshots/native/native_test.go @@ -14,7 +14,7 @@ limitations under the License. */ -package naive +package native import ( "context" diff --git a/snapshotter_default_unix.go b/snapshotter_default_unix.go index abd8f8694..eb001c7d3 100644 --- a/snapshotter_default_unix.go +++ b/snapshotter_default_unix.go @@ -22,5 +22,5 @@ const ( // DefaultSnapshotter will set the default snapshotter for the platform. // This will be based on the client compilation target, so take that into // account when choosing this value. - DefaultSnapshotter = "naive" + DefaultSnapshotter = "native" )