driver

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMountTable added in v1.6.6

func NewMountTable(mounter Mounter) mountTable

func NewOverlayDriver added in v1.6.5

func NewOverlayDriver(volumesDir, overlaysDir string) (volume.Driver, error)

func RecoverMountTable added in v1.6.6

func RecoverMountTable(root string, mounter Mounter) error

RecoverMountTable takes care of mounting volumes that exist under `live`, but are not yet mounted due to a system shutdown.

It takes care of finding out the dependencies between volumes (represented by symbolic links at `live/<vol>/parent`), and making sure that: - dependencies are mounted first - mountpoints are not mounted more than once

 e.g, given the following `live` dir:

		.
		└── live
		    ├── vol1
		    ├── vol2
		    │   └── parent -> ./vol3
		    ├── vol3
		    │   └── parent -> ./vol1
		    └── vol4
			└── parent -> ./vol1

it figures out an acceptable mounting order is `vol1`, `vol3`, `vol2`, `vol4`, issuing precisely only 4 `mount`s.

Types

type BtrFSDriver

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

func NewBtrFSDriver

func NewBtrFSDriver(
	logger lager.Logger,
	btrfsBin string,
) *BtrFSDriver

func (*BtrFSDriver) CreateCopyOnWriteLayer

func (driver *BtrFSDriver) CreateCopyOnWriteLayer(path string, parent string) error

func (*BtrFSDriver) CreateVolume

func (driver *BtrFSDriver) CreateVolume(path string) error

func (*BtrFSDriver) DestroyVolume

func (driver *BtrFSDriver) DestroyVolume(path string) error

type LiveVolume added in v1.6.6

type LiveVolume struct {
	Path   string
	Parent *LiveVolume
}

func Ancestry added in v1.6.6

func Ancestry(vol LiveVolume) []LiveVolume

Ancestry traverses LiveVolume linked list producing a list of LiveVolumes from "no dependencies" (oldest) to "with dependencies" (youngest).

func NewLiveVolume added in v1.6.6

func NewLiveVolume(root, vol string) (*LiveVolume, error)

NewLiveVolume creates the representation of a volume under the `live` directory.

It captures the filepath to the volume, as well as its parents (in a singly linked list).

ps.: it DOES NOT protect itself against circular dependencies.

type Mounter added in v1.6.6

type Mounter interface {
	BindMount(datapath string) error
	OverlayMount(parent, datapath string) error
}

type NaiveDriver

type NaiveDriver struct{}

func (*NaiveDriver) CreateCopyOnWriteLayer

func (driver *NaiveDriver) CreateCopyOnWriteLayer(path string, parent string) error

func (*NaiveDriver) CreateVolume

func (driver *NaiveDriver) CreateVolume(path string) error

func (*NaiveDriver) DestroyVolume

func (driver *NaiveDriver) DestroyVolume(path string) error

type OverlayDriver

type OverlayDriver struct {
	VolumesDir  string
	OverlaysDir string
}

func (*OverlayDriver) BindMount added in v1.6.6

func (driver *OverlayDriver) BindMount(datapath string) error

func (*OverlayDriver) CreateCopyOnWriteLayer

func (driver *OverlayDriver) CreateCopyOnWriteLayer(path string, parent string) error

func (*OverlayDriver) CreateVolume

func (driver *OverlayDriver) CreateVolume(path string) error

func (*OverlayDriver) DestroyVolume

func (driver *OverlayDriver) DestroyVolume(path string) error

func (*OverlayDriver) OverlayMount added in v1.6.6

func (driver *OverlayDriver) OverlayMount(mountpoint, parent string) error

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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