snapshot

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 26 Imported by: 530

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContainerdSnapshotter

func NewContainerdSnapshotter(s Snapshotter) (snapshots.Snapshotter, func() error)

NewContainerdSnapshotter converts snapshotter to containerd snapshotter

Types

type Diff added in v0.10.0

type Diff struct {
	Lower string
	Upper string
}

type LocalMounterOpt added in v0.12.5

type LocalMounterOpt func(*localMounter)

func ForceRemount added in v0.12.5

func ForceRemount() LocalMounterOpt

type MergeSnapshotter added in v0.10.0

type MergeSnapshotter interface {
	Snapshotter
	// Merge creates a snapshot whose contents are the provided diffs applied onto one
	// another in the provided order, starting from scratch. The diffs are calculated
	// the same way that diffs are calculated during exports, which ensures that the
	// result of merging these diffs looks the same as exporting the diffs as layer
	// blobs and unpacking them as an image.
	//
	// Each key in the provided diffs is expected to be a committed snapshot. The
	// snapshot created by Merge is also committed.
	//
	// The size of a merged snapshot (as returned by the Usage method) depends on the merge
	// implementation. Implementations using hardlinks to create merged views will take up
	// less space than those that use copies, for example.
	Merge(ctx context.Context, key string, diffs []Diff, opts ...snapshots.Opt) error
}

func NewMergeSnapshotter added in v0.10.0

func NewMergeSnapshotter(ctx context.Context, sn Snapshotter, lm leases.Manager) MergeSnapshotter

type Mountable

type Mountable = executor.MountableRef

type Mounter

type Mounter interface {
	Mount() (string, error)
	Unmount() error
}

func LocalMounter

func LocalMounter(mountable Mountable, opts ...LocalMounterOpt) Mounter

LocalMounter is a helper for mounting mountfactory to temporary path. In addition it can mount binds without privileges

func LocalMounterWithMounts

func LocalMounterWithMounts(mounts []mount.Mount, opts ...LocalMounterOpt) Mounter

LocalMounterWithMounts is a helper for mounting to temporary path. In addition it can mount binds without privileges

type Snapshotter

type Snapshotter interface {
	Name() string
	Mounts(ctx context.Context, key string) (Mountable, error)
	Prepare(ctx context.Context, key, parent string, opts ...snapshots.Opt) error
	View(ctx context.Context, key, parent string, opts ...snapshots.Opt) (Mountable, error)

	Stat(ctx context.Context, key string) (snapshots.Info, error)
	Update(ctx context.Context, info snapshots.Info, fieldpaths ...string) (snapshots.Info, error)
	Usage(ctx context.Context, key string) (snapshots.Usage, error)
	Commit(ctx context.Context, name, key string, opts ...snapshots.Opt) error
	Remove(ctx context.Context, key string) error
	Walk(ctx context.Context, fn snapshots.WalkFunc, filters ...string) error
	Close() error
	IdentityMapping() *idtools.IdentityMapping
}

Snapshotter defines interface that any snapshot implementation should satisfy

func FromContainerdSnapshotter

func FromContainerdSnapshotter(name string, s snapshots.Snapshotter, idmap *idtools.IdentityMapping) Snapshotter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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