zfs: seperate implementation pkg from plugin pkg and revendor
Signed-off-by: Siddharth Yadav <sedflix@gmail.com>
This commit is contained in:
18
vendor/github.com/containerd/zfs/zfs.go
generated
vendored
18
vendor/github.com/containerd/zfs/zfs.go
generated
vendored
@@ -20,16 +20,13 @@ package zfs
|
||||
|
||||
import (
|
||||
"context"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/containerd/containerd/log"
|
||||
"github.com/containerd/containerd/mount"
|
||||
"github.com/containerd/containerd/platforms"
|
||||
"github.com/containerd/containerd/plugin"
|
||||
"github.com/containerd/containerd/snapshots"
|
||||
"github.com/containerd/containerd/snapshots/storage"
|
||||
zfs "github.com/mistifyio/go-zfs"
|
||||
"github.com/pkg/errors"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -39,17 +36,6 @@ const (
|
||||
snapshotSuffix = "snapshot"
|
||||
)
|
||||
|
||||
func init() {
|
||||
plugin.Register(&plugin.Registration{
|
||||
Type: plugin.SnapshotPlugin,
|
||||
ID: "zfs",
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
ic.Meta.Platforms = append(ic.Meta.Platforms, platforms.DefaultSpec())
|
||||
ic.Meta.Exports["root"] = ic.Root
|
||||
return NewSnapshotter(ic.Root)
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
type snapshotter struct {
|
||||
dataset *zfs.Dataset
|
||||
@@ -66,7 +52,7 @@ func NewSnapshotter(root string) (snapshots.Snapshotter, error) {
|
||||
return nil, err
|
||||
}
|
||||
if m.FSType != "zfs" {
|
||||
return nil, errors.Wrapf(plugin.ErrSkipPlugin, "path %s must be a zfs filesystem to be used with the zfs snapshotter", root)
|
||||
return nil, errors.Errorf("path %s must be a zfs filesystem to be used with the zfs snapshotter", root)
|
||||
}
|
||||
dataset, err := zfs.GetDataset(m.Source)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user