snapshot

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 18 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsynchronousRemove

func AsynchronousRemove(config *SnapshotterConfig) error

AsynchronousRemove defers removal of filesystem content until the Cleanup method is called. Removals will make the snapshot referred to by the key unavailable and make the key immediately available for re-use.

func NewSnapshotter

func NewSnapshotter(ctx context.Context, root string, targetFs FileSystem, opts ...Opt) (snapshots.Snapshotter, error)

NewSnapshotter returns a Snapshotter which can use unpacked remote layers as snapshots. This is implemented based on the overlayfs snapshotter, so diffs are stored under the provided root and a metadata file is stored under the root as same as overlayfs snapshotter.

Types

type FileSystem

type FileSystem interface {
	Mount(ctx context.Context, mountpoint string, labels map[string]string) error
	Check(ctx context.Context, mountpoint string, labels map[string]string) error
	Unmount(ctx context.Context, mountpoint string) error
}

FileSystem is a backing filesystem abstraction.

Mount() tries to mount a remote snapshot to the specified mount point directory. If succeed, the mountpoint directory will be treated as a layer snapshot. If Mount() fails, the mountpoint directory MUST be cleaned up. Check() is called to check the connectibity of the existing layer snapshot every time the layer is used by containerd. Unmount() is called to unmount a remote snapshot from the specified mount point directory.

type Opt

type Opt func(config *SnapshotterConfig) error

Opt is an option to configure the remote snapshotter

type SnapshotterConfig

type SnapshotterConfig struct {
	// contains filtered or unexported fields
}

SnapshotterConfig is used to configure the remote snapshotter instance

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL