Documentation
¶
Index ¶
- func NewMountTable(mounter Mounter) mountTable
- func NewOverlayDriver(volumesDir, overlaysDir string) (volume.Driver, error)
- func RecoverMountTable(root string, mounter Mounter) error
- type BtrFSDriver
- type LiveVolume
- type Mounter
- type NaiveDriver
- type OverlayDriver
- func (driver *OverlayDriver) BindMount(datapath string) error
- func (driver *OverlayDriver) CreateCopyOnWriteLayer(path string, parent string) error
- func (driver *OverlayDriver) CreateVolume(path string) error
- func (driver *OverlayDriver) DestroyVolume(path string) error
- func (driver *OverlayDriver) OverlayMount(mountpoint, parent string) error
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 RecoverMountTable ¶ added in v1.6.6
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 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 ¶
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