Skip to content

Commit

Permalink
Merge pull request #75 from thaJeztah/update_status_badge
Browse files Browse the repository at this point in the history
gofumpt and update status badges
  • Loading branch information
AkihiroSuda authored May 26, 2023
2 parents b56cb89 + 5e3457b commit 2613429
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# [containerd](https://github.com/containerd/containerd) ZFS snapshotter plugin

[![Build Status](https://github.com/containerd/zfs/workflows/CI/badge.svg)](https://github.com/containerd/zfs/actions?query=workflow%3ACI)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/containerd/zfs)](https://pkg.go.dev/github.com/containerd/zfs)
[![Build Status](https://github.com/containerd/zfs/actions/workflows/ci.yml/badge.svg)](https://github.com/containerd/zfs/actions/workflows/ci.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/containerd/zfs)](https://goreportcard.com/report/github.com/containerd/zfs)
[![codecov](https://codecov.io/gh/containerd/zfs/branch/main/graph/badge.svg)](https://codecov.io/gh/containerd/zfs)

ZFS snapshotter plugin for containerd.
Expand Down
9 changes: 3 additions & 6 deletions zfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,9 @@ func NewSnapshotter(root string) (snapshots.Snapshotter, error) {
return b, nil
}

var (
zfsCreateProperties = map[string]string{
"mountpoint": "legacy",
}
)
var zfsCreateProperties = map[string]string{
"mountpoint": "legacy",
}

// createFilesystem creates but not mount.
func createFilesystem(datasetName string) (*zfs.Dataset, error) {
Expand Down Expand Up @@ -138,7 +136,6 @@ func (z *snapshotter) usage(ctx context.Context, key string) (snapshots.Usage, e
if info.Kind == snapshots.KindActive {
activeName := filepath.Join(z.dataset.Name, id)
sDataset, err := zfs.GetDataset(activeName)

if err != nil {
return snapshots.Usage{}, err
}
Expand Down
10 changes: 3 additions & 7 deletions zfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,7 @@ func TestZFSUsage(t *testing.T) {
ctx := context.Background()

// Create temporary directory
root, err := os.MkdirTemp("", "TestZFSUsage-")
if err != nil {
t.Error(err)
}
defer os.RemoveAll(root)
root := t.TempDir()

// Create the snapshotter
z, closer, err := newSnapshotter()(ctx, root)
Expand Down Expand Up @@ -142,7 +138,7 @@ func TestZFSUsage(t *testing.T) {
)

// Create a child layer with a 1MB file
baseApplier := fstest.Apply(fstest.CreateRandomFile("/a", 12345679, oneMB, 0777))
baseApplier := fstest.Apply(fstest.CreateRandomFile("/a", 12345679, oneMB, 0o777))

target = filepath.Join(root, "prepare-2")
mounts, err := z.Prepare(ctx, target, filepath.Join(root, "layer-1"))
Expand Down Expand Up @@ -172,7 +168,7 @@ func TestZFSUsage(t *testing.T) {
}

// Create another child layer with a 2MB file
baseApplier = fstest.Apply(fstest.CreateRandomFile("/b", 12345679, twoMB, 0777))
baseApplier = fstest.Apply(fstest.CreateRandomFile("/b", 12345679, twoMB, 0o777))

target = filepath.Join(root, "prepare-3")
mounts, err = z.Prepare(ctx, target, filepath.Join(root, "layer-2"))
Expand Down

0 comments on commit 2613429

Please sign in to comment.