overlay

package
v1.4.13 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: Apache-2.0 Imports: 17 Imported by: 168

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsynchronousRemove added in v1.1.0

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 NeedsUserXAttr added in v1.4.5

func NeedsUserXAttr(d string) (bool, error)

NeedsUserXAttr returns whether overlayfs should be mounted with the "userxattr" mount option.

The "userxattr" option is needed for mounting overlayfs inside a user namespace with kernel >= 5.11.

The "userxattr" option is NOT needed for the initial user namespace (aka "the host").

Also, Ubuntu (since circa 2015) and Debian (since 10) with kernel < 5.11 can mount the overlayfs in a user namespace without the "userxattr" option.

The corresponding kernel commit: https://github.com/torvalds/linux/commit/2d2f2d7322ff43e0fe92bf8cccdc0b09449bf2e1 > ovl: user xattr > > Optionally allow using "user.overlay." namespace instead of "trusted.overlay." > ... > Disable redirect_dir and metacopy options, because these would allow privilege escalation through direct manipulation of the > "user.overlay.redirect" or "user.overlay.metacopy" xattrs. > ...

The "userxattr" support is not exposed in "/sys/module/overlay/parameters".

func NewSnapshotter

func NewSnapshotter(root string, opts ...Opt) (snapshots.Snapshotter, error)

NewSnapshotter returns a Snapshotter which uses overlayfs. The overlayfs diffs are stored under the provided root. A metadata file is stored under the root.

func Supported added in v1.1.0

func Supported(root string) error

Supported returns nil when the overlayfs is functional on the system with the root directory. Supported is not called during plugin initialization, but exposed for downstream projects which uses this snapshotter as a library.

Types

type Opt added in v1.1.0

type Opt func(config *SnapshotterConfig) error

Opt is an option to configure the overlay snapshotter

type SnapshotterConfig added in v1.1.0

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

SnapshotterConfig is used to configure the overlay snapshotter instance

Jump to

Keyboard shortcuts

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