The new `libimage` package is an attempt to consolidate the code for managing container images and performing operations on them such as pulling, pushing, saving, searching, local lookups, removing etc. Over time, Buildah, CRI-O and Podman diverged with respect to managing container images resulting in a high amount of code duplication rendering the tools harder to maintain (e.g., bug fixes) and harder to extend (e.g., adding new features) than necessary. The desire to share all that code in a common library grew and this is an attempt to address the it. The changes as they are now pass Buildah CI [1]. Once merged into Buildah, I expect follow up changes when migrating Podman over to `libimage`. Miscellaneous changes: * Copy `podman/pkg/signal` to `pkg/signal`. * Copy `buildah/manifests` to `image/manifests`. Note that the unit tests require root privileges. Skip()'s are added when running rootless. Currently excluded from linting. * Copy `buildah/pkg/manifests` to `pkg/manifests`. Currently excluded from linting. * Copy `buildah/pkg/supplemented` to `pkg/supplemented`. Currently excluded from linting. [1] github.com/containers/buildah/pull/3148 Signed-off-by: Valentin Rothberg <rothberg@redhat.com> |
||
|---|---|---|
| .. | ||
| .gitignore | ||
| .travis.yml | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| README.md | ||
| Vagrantfile | ||
| error.go | ||
| utils.go | ||
| utils_notsolaris.go | ||
| utils_solaris.go | ||
| zfs.go | ||
| zpool.go | ||
README.md
Go Wrapper for ZFS
Simple wrappers for ZFS command line tools.
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