File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,5 +23,5 @@ import (
2323 _ "github.com/containerd/containerd/runtime/v2"
2424 _ "github.com/containerd/containerd/runtime/v2/runc/options"
2525 _ "github.com/containerd/containerd/snapshots/native"
26- _ "github.com/containerd/containerd/snapshots/overlay"
26+ _ "github.com/containerd/containerd/snapshots/overlay/plugin "
2727)
Original file line number Diff line number Diff line change @@ -29,38 +29,12 @@ import (
2929
3030 "github.com/containerd/containerd/log"
3131 "github.com/containerd/containerd/mount"
32- "github.com/containerd/containerd/platforms"
33- "github.com/containerd/containerd/plugin"
3432 "github.com/containerd/containerd/snapshots"
3533 "github.com/containerd/containerd/snapshots/storage"
3634 "github.com/containerd/continuity/fs"
3735 "github.com/pkg/errors"
3836)
3937
40- func init () {
41- plugin .Register (& plugin.Registration {
42- Type : plugin .SnapshotPlugin ,
43- ID : "overlayfs" ,
44- Config : & Config {},
45- InitFn : func (ic * plugin.InitContext ) (interface {}, error ) {
46- ic .Meta .Platforms = append (ic .Meta .Platforms , platforms .DefaultSpec ())
47-
48- config , ok := ic .Config .(* Config )
49- if ! ok {
50- return nil , errors .New ("invalid overlay configuration" )
51- }
52-
53- root := ic .Root
54- if config .RootPath != "" {
55- root = config .RootPath
56- }
57-
58- ic .Meta .Exports ["root" ] = root
59- return NewSnapshotter (root , AsynchronousRemove )
60- },
61- })
62- }
63-
6438// SnapshotterConfig is used to configure the overlay snapshotter instance
6539type SnapshotterConfig struct {
6640 asyncRemove bool
Original file line number Diff line number Diff line change 1818
1919package overlay
2020
21+ import (
22+ "errors"
23+
24+ "github.com/containerd/containerd/platforms"
25+ "github.com/containerd/containerd/plugin"
26+ "github.com/containerd/containerd/snapshots/overlay"
27+ )
28+
2129// Config represents configuration for the overlay plugin.
2230type Config struct {
2331 // Root directory for the plugin
2432 RootPath string `toml:"root_path"`
2533}
34+
35+ func init () {
36+ plugin .Register (& plugin.Registration {
37+ Type : plugin .SnapshotPlugin ,
38+ ID : "overlayfs" ,
39+ Config : & Config {},
40+ InitFn : func (ic * plugin.InitContext ) (interface {}, error ) {
41+ ic .Meta .Platforms = append (ic .Meta .Platforms , platforms .DefaultSpec ())
42+
43+ config , ok := ic .Config .(* Config )
44+ if ! ok {
45+ return nil , errors .New ("invalid overlay configuration" )
46+ }
47+
48+ root := ic .Root
49+ if config .RootPath != "" {
50+ root = config .RootPath
51+ }
52+
53+ ic .Meta .Exports ["root" ] = root
54+ return overlay .NewSnapshotter (root , overlay .AsynchronousRemove )
55+ },
56+ })
57+ }
You can’t perform that action at this time.
0 commit comments