Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9ea7966

Browse files
committed
Return skip error on unsupported fs
This allows the caller to handle the error as they see fit. Signed-off-by: Michael Crosby <[email protected]>
1 parent 39692b4 commit 9ea7966

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

zfs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func NewSnapshotter(root string) (snapshots.Snapshotter, error) {
5050
return nil, err
5151
}
5252
if m.FSType != "zfs" {
53-
return nil, errors.Errorf("path %s must be a zfs filesystem to be used with the zfs snapshotter", root)
53+
return nil, errors.Wrapf(plugin.ErrSkipPlugin, "path %s must be a zfs filesystem to be used with the zfs snapshotter", root)
5454
}
5555
dataset, err := zfs.GetDataset(m.Source)
5656
if err != nil {

zfs_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ import (
1414
"github.com/containerd/containerd/pkg/testutil"
1515
"github.com/containerd/containerd/snapshots"
1616
"github.com/containerd/containerd/snapshots/testsuite"
17+
"github.com/containerd/continuity/testutil/loopback"
1718
zfs "github.com/mistifyio/go-zfs"
1819
"github.com/pkg/errors"
1920
)
2021

2122
func newTestZpool() (string, func() error, error) {
22-
lo, destroyLo, err := testutil.NewLoopback(1 << 30) // 1GiB
23+
lo, destroyLo, err := loopback.New(1 << 30) // 1GiB
2324
if err != nil {
2425
return "", nil, err
2526
}

0 commit comments

Comments
 (0)