containerd/vendor/github.com/mistifyio/go-zfs/v3
Akihiro Suda 778defa31f
Add back ZFS snapshotter
Fix issue 10889

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-10-25 00:10:20 +09:00
..
.envrc Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
.gitignore Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
.golangci.yml Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
.yamllint Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
CHANGELOG.md Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
CONTRIBUTING.md Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
error.go Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
LICENSE Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
lint.mk Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
Makefile Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
README.md Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
rules.mk Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
shell.nix Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
utils_notsolaris.go Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
utils_solaris.go Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
utils.go Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
Vagrantfile Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
zfs.go Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00
zpool.go Add back ZFS snapshotter 2024-10-25 00:10:20 +09:00

Go Wrapper for ZFS

Simple wrappers for ZFS command line tools.

GoDoc

Requirements

You need a working ZFS setup. To use on Ubuntu 14.04, setup ZFS:

sudo apt-get install python-software-properties
sudo apt-add-repository ppa:zfs-native/stable
sudo apt-get update
sudo apt-get install ubuntu-zfs libzfs-dev

Developed using Go 1.3, but currently there isn't anything 1.3 specific. Don't use Ubuntu packages for Go, use http://golang.org/doc/install

Generally you need root privileges to use anything zfs related.

Status

This has been only been tested on Ubuntu 14.04

In the future, we hope to work directly with libzfs.

Hacking

The tests have decent examples for most functions.

//assuming a zpool named test
//error handling omitted


f, err := zfs.CreateFilesystem("test/snapshot-test", nil)
ok(t, err)

s, err := f.Snapshot("test", nil)
ok(t, err)

// snapshot is named "test/snapshot-test@test"

c, err := s.Clone("test/clone-test", nil)

err := c.Destroy()
err := s.Destroy()
err := f.Destroy()

Contributing

See the contributing guidelines