Skip to content

Commit 83e35b3

Browse files
committed
enable native (formerly naive) snapshotter by default
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
1 parent bf5112e commit 83e35b3

File tree

7 files changed

+19
-18
lines changed

7 files changed

+19
-18
lines changed

cmd/containerd/builtins_linux.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
_ "github.com/containerd/aufs"
2121
_ "github.com/containerd/containerd/linux"
2222
_ "github.com/containerd/containerd/metrics/cgroups"
23+
_ "github.com/containerd/containerd/snapshots/native"
2324
_ "github.com/containerd/containerd/snapshots/overlay"
2425
_ "github.com/containerd/zfs"
2526
)

cmd/containerd/builtins_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
package main
2020

2121
import (
22-
_ "github.com/containerd/containerd/snapshots/naive"
22+
_ "github.com/containerd/containerd/snapshots/native"
2323
)

metadata/db_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939
"github.com/containerd/containerd/images"
4040
"github.com/containerd/containerd/namespaces"
4141
"github.com/containerd/containerd/snapshots"
42-
"github.com/containerd/containerd/snapshots/naive"
42+
"github.com/containerd/containerd/snapshots/native"
4343
"github.com/gogo/protobuf/types"
4444
digest "github.com/opencontainers/go-digest"
4545
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
@@ -55,7 +55,7 @@ func testDB(t *testing.T) (context.Context, *DB, func()) {
5555
t.Fatal(err)
5656
}
5757

58-
snapshotter, err := naive.NewSnapshotter(filepath.Join(dirname, "naive"))
58+
snapshotter, err := native.NewSnapshotter(filepath.Join(dirname, "native"))
5959
if err != nil {
6060
t.Fatal(err)
6161
}
@@ -70,7 +70,7 @@ func testDB(t *testing.T) (context.Context, *DB, func()) {
7070
t.Fatal(err)
7171
}
7272

73-
db := NewDB(bdb, cs, map[string]snapshots.Snapshotter{"naive": snapshotter})
73+
db := NewDB(bdb, cs, map[string]snapshots.Snapshotter{"native": snapshotter})
7474
if err := db.Init(ctx); err != nil {
7575
t.Fatal(err)
7676
}
@@ -544,7 +544,7 @@ func create(obj object, tx *bolt.Tx, is images.Store, cs content.Store, sn snaps
544544
node = &gc.Node{
545545
Type: ResourceSnapshot,
546546
Namespace: namespace,
547-
Key: fmt.Sprintf("naive/%s", v.key),
547+
Key: fmt.Sprintf("native/%s", v.key),
548548
}
549549
}
550550
case testImage:
@@ -563,7 +563,7 @@ func create(obj object, tx *bolt.Tx, is images.Store, cs content.Store, sn snaps
563563
container := containers.Container{
564564
ID: v.id,
565565
SnapshotKey: v.snapshot,
566-
Snapshotter: "naive",
566+
Snapshotter: "native",
567567
Labels: obj.labels,
568568

569569
Runtime: containers.RuntimeInfo{
@@ -658,7 +658,7 @@ func newStores(t testing.TB) (*DB, content.Store, snapshots.Snapshotter, func())
658658
t.Fatal(err)
659659
}
660660

661-
nsn, err := naive.NewSnapshotter(filepath.Join(td, "snapshots"))
661+
nsn, err := native.NewSnapshotter(filepath.Join(td, "snapshots"))
662662
if err != nil {
663663
t.Fatal(err)
664664
}
@@ -668,9 +668,9 @@ func newStores(t testing.TB) (*DB, content.Store, snapshots.Snapshotter, func())
668668
t.Fatal(err)
669669
}
670670

671-
mdb := NewDB(db, lcs, map[string]snapshots.Snapshotter{"naive": nsn})
671+
mdb := NewDB(db, lcs, map[string]snapshots.Snapshotter{"native": nsn})
672672

673-
return mdb, mdb.ContentStore(), mdb.Snapshotter("naive"), func() {
673+
return mdb, mdb.ContentStore(), mdb.Snapshotter("native"), func() {
674674
os.RemoveAll(td)
675675
}
676676
}

metadata/snapshot_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ import (
2525

2626
"github.com/boltdb/bolt"
2727
"github.com/containerd/containerd/snapshots"
28-
"github.com/containerd/containerd/snapshots/naive"
28+
"github.com/containerd/containerd/snapshots/native"
2929
"github.com/containerd/containerd/snapshots/testsuite"
3030
"github.com/containerd/containerd/testutil"
3131
)
3232

3333
func newTestSnapshotter(ctx context.Context, root string) (snapshots.Snapshotter, func() error, error) {
34-
naiveRoot := filepath.Join(root, "naive")
35-
if err := os.Mkdir(naiveRoot, 0770); err != nil {
34+
nativeRoot := filepath.Join(root, "native")
35+
if err := os.Mkdir(nativeRoot, 0770); err != nil {
3636
return nil, nil, err
3737
}
38-
snapshotter, err := naive.NewSnapshotter(naiveRoot)
38+
snapshotter, err := native.NewSnapshotter(nativeRoot)
3939
if err != nil {
4040
return nil, nil, err
4141
}
@@ -45,7 +45,7 @@ func newTestSnapshotter(ctx context.Context, root string) (snapshots.Snapshotter
4545
return nil, nil, err
4646
}
4747

48-
sn := NewDB(db, nil, map[string]snapshots.Snapshotter{"naive": snapshotter}).Snapshotter("naive")
48+
sn := NewDB(db, nil, map[string]snapshots.Snapshotter{"native": snapshotter}).Snapshotter("native")
4949

5050
return sn, func() error {
5151
if err := sn.Close(); err != nil {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package naive
17+
package native
1818

1919
import (
2020
"context"
@@ -35,7 +35,7 @@ import (
3535
func init() {
3636
plugin.Register(&plugin.Registration{
3737
Type: plugin.SnapshotPlugin,
38-
ID: "naive",
38+
ID: "native",
3939
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
4040
ic.Meta.Platforms = append(ic.Meta.Platforms, platforms.DefaultSpec())
4141
return NewSnapshotter(ic.Root)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package naive
17+
package native
1818

1919
import (
2020
"context"

snapshotter_default_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ const (
2222
// DefaultSnapshotter will set the default snapshotter for the platform.
2323
// This will be based on the client compilation target, so take that into
2424
// account when choosing this value.
25-
DefaultSnapshotter = "naive"
25+
DefaultSnapshotter = "native"
2626
)

0 commit comments

Comments
 (0)