snapshot

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoDir = "overlayfs" // overlayfs as rootfs. upper + lower (overlaybd)
	RwDir = "dir"       // mount overlaybd as rootfs
	RwDev = "dev"       // use overlaybd directly

	LayerBlob = "layer" // decompressed tgz layer (maybe compressed by ZFile)
)

Variables

This section is empty.

Functions

func AsynchronousRemove added in v1.3.0

func AsynchronousRemove(config *BootConfig) 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 IsErofsFilesystem added in v1.2.2

func IsErofsFilesystem(path string) bool

determine whether the block device represented by @path is eorfs filesystem

func IsErofsSupported added in v1.2.3

func IsErofsSupported() bool

If EROFS fsmeta exists and is prioritized, check and modprobe erofs

func NewSnapshotter

func NewSnapshotter(bootConfig *BootConfig, opts ...Opt) (snapshots.Snapshotter, error)

NewSnapshotter returns a Snapshotter which uses block device based on overlayFS.

Types

type BootConfig added in v0.6.0

type BootConfig struct {
	AsyncRemove       bool                   `json:"asyncRemove"`
	Address           string                 `json:"address"`
	Root              string                 `json:"root"`
	LogLevel          string                 `json:"verbose"`
	LogReportCaller   bool                   `json:"logReportCaller"`
	RwMode            string                 `json:"rwMode"` // overlayfs, dir or dev
	AutoRemoveDev     bool                   `json:"autoRemoveDev"`
	ExporterConfig    metrics.ExporterConfig `json:"exporterConfig"`
	WritableLayerType string                 `json:"writableLayerType"` // append or sparse
	MirrorRegistry    []Registry             `json:"mirrorRegistry"`
	DefaultFsType     string                 `json:"defaultFsType"`
	RootfsQuota       string                 `json:"rootfsQuota"` // "20g" rootfs quota, only effective when rwMode is 'overlayfs'
	Tenant            int                    `json:"tenant"`      // do not set this if only a single snapshotter service in the host
	TurboFsType       []string               `json:"turboFsType"`
}

func DefaultBootConfig added in v0.6.0

func DefaultBootConfig() *BootConfig

type Opt

type Opt func(config *SnapshotterConfig) error

Opt is an option to configure the snapshotter

type Registry added in v1.0.1

type Registry struct {
	Host     string `json:"host"`
	Insecure bool   `json:"insecure"`
}

type SnapshotterConfig

type SnapshotterConfig struct {
	// OverlayBDUtilBinDir contains overlaybd-create/overlaybd-commit tools
	// to handle writable device.
	OverlayBDUtilBinDir string `toml:"overlaybd_util_bin_dir" json:"overlaybd_util_bin_dir"`
}

SnapshotterConfig is used to configure the snapshotter instance

type ZFileConfig added in v0.6.0

type ZFileConfig struct {
	Algorithm string `json:"algorithm"`
	BlockSize int    `json:"blockSize"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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