Setup plugin ids and dependencies

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-06-08 09:45:22 -07:00
parent 6bbed2c125
commit 94e7f8e943
31 changed files with 331 additions and 319 deletions

View File

@@ -20,11 +20,11 @@ import (
)
func init() {
plugin.Register("snapshot-btrfs", &plugin.Registration{
plugin.Register(&plugin.Registration{
ID: "btrfs",
Type: plugin.SnapshotPlugin,
Init: func(ic *plugin.InitContext) (interface{}, error) {
root := filepath.Join(ic.Root, "snapshot", "btrfs")
return NewSnapshotter(root)
return NewSnapshotter(ic.Root)
},
})
}

View File

@@ -16,10 +16,11 @@ import (
)
func init() {
plugin.Register("snapshot-naive", &plugin.Registration{
plugin.Register(&plugin.Registration{
Type: plugin.SnapshotPlugin,
ID: "naive",
Init: func(ic *plugin.InitContext) (interface{}, error) {
return NewSnapshotter(filepath.Join(ic.Root, "snapshot", "naive"))
return NewSnapshotter(ic.Root)
},
})
}

View File

@@ -20,10 +20,11 @@ import (
)
func init() {
plugin.Register("snapshot-overlay", &plugin.Registration{
plugin.Register(&plugin.Registration{
Type: plugin.SnapshotPlugin,
ID: "overlayfs",
Init: func(ic *plugin.InitContext) (interface{}, error) {
return NewSnapshotter(filepath.Join(ic.Root, "snapshot", "overlay"))
return NewSnapshotter(ic.Root)
},
})
}

View File

@@ -4,7 +4,6 @@ package windows
import (
"context"
"path/filepath"
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/plugin"
@@ -17,10 +16,11 @@ var (
)
func init() {
plugin.Register("snapshot-windows", &plugin.Registration{
plugin.Register(&plugin.Registration{
Type: plugin.SnapshotPlugin,
ID: "windows",
Init: func(ic *plugin.InitContext) (interface{}, error) {
return NewSnapshotter(filepath.Join(ic.Root, "snapshot", "windows"))
return NewSnapshotter(ic.Root)
},
})
}