Documentation
¶
Index ¶
- Constants
- func AsynchronousRemove(config *BootConfig) error
- func AttachDevice(ctx context.Context, params *AttachDeviceParams) (devName string, e error)
- func DetachDevice(ctx context.Context, snID string, tenant int) (err error)
- func IsDockerContainerLayer(parent string) bool
- func IsDockerInitLayer(key string) bool
- func IsErofsFilesystem(path string) bool
- func IsErofsSupported() bool
- func NewSnapshotter(bootConfig *BootConfig, opts ...Opt) (snapshots.Snapshotter, error)
- type AttachDeviceParams
- type BootConfig
- type Opt
- type Registry
- type SnapshotterConfig
- type ZFileConfig
Constants ¶
const ( RoDir = "overlayfs" // overlayfs as rootfs. upper + lower (overlaybd) RwDir = "dir" // mount overlaybd as rootfs, return overlaybd mountpoint RwDev = "dev" // use overlaybd directly, return overlaybd devName LayerBlob = "layer" // decompressed tgz layer (maybe compressed by ZFile) )
const (
DockerInitSuffix = "-init"
)
Docker runtime constants
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 AttachDevice ¶ added in v1.4.0
func AttachDevice(ctx context.Context, params *AttachDeviceParams) (devName string, e error)
func DetachDevice ¶ added in v1.4.0
func IsDockerContainerLayer ¶ added in v1.4.3
IsDockerContainerLayer checks if the parent is a Docker init layer
func IsDockerInitLayer ¶ added in v1.4.3
IsDockerInitLayer checks if this is a Docker init layer Docker uses "-init-key" for prepare and "-init" for committed snapshot
func IsErofsFilesystem ¶ added in v1.2.2
IsErofsFilesystem determines whether the block device represented by @path is eorfs filesystem.
func IsErofsSupported ¶ added in v1.2.3
func IsErofsSupported() bool
IsErofsSupported checks 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 AttachDeviceParams ¶ added in v1.4.0
type AttachDeviceParams struct {
// contains filtered or unexported fields
}
func NewAttachDeviceParams ¶ added in v1.4.0
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"`
RuntimeType string `json:"runtimeType"` // "containerd" (default) or "docker"
}
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 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