package snapshot

import "github.com/containerd/stargz-snapshotter/snapshot"

Index

Functions

func AllowInvalidMountsOnRestart

func AllowInvalidMountsOnRestart(config *SnapshotterConfig) error

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.

func NoRestore

func NoRestore(config *SnapshotterConfig) error

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

Source Files

snapshot.go

Version
v0.16.3 (latest)
Published
Dec 12, 2024
Platform
linux/amd64
Imports
15 packages
Last checked
2 weeks ago

Tools for package owners.