mountedvolume

package
v0.0.0-...-f3facc4 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: EPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HideRoot

func HideRoot() error

HideRoot hides the root folder by performing a mount of a tmpfs on top of the /root folder.

func UnhideRoot

func UnhideRoot() error

UnhideRoot unhides the root folder by performing a unmount of the tmpfs that is on top of the /root folder.

Types

type Driver

type Driver struct {
	DriverCallback
	// contains filtered or unexported fields
}

Driver extends the volume.Driver by implementing template versions of the methods.

func NewDriver

func NewDriver(mountExecutable string, mountPointAfterOptions bool, dockerSocketName string, scope string) *Driver

NewDriver constructor for Driver

func (*Driver) Capabilities

func (p *Driver) Capabilities() *volume.CapabilitiesResponse

Capabilities indicate to the swarm manager that this supports global scope.

func (*Driver) Close

func (p *Driver) Close()

Close clean up resources used by the driver

func (*Driver) Create

func (p *Driver) Create(req *volume.CreateRequest) error

Create attempts to create the volume, if it has been created already it will return an error if it is already present.

func (*Driver) Get

func (p *Driver) Get(req *volume.GetRequest) (*volume.GetResponse, error)

Get obtain information for specific single volume.

func (*Driver) Init

func (p *Driver) Init(callback DriverCallback)

Init sets the callback handler to the driver. This needs to be called before ServeUnix()

func (*Driver) List

func (p *Driver) List() (*volume.ListResponse, error)

List obtain information for all volumes registered.

func (*Driver) Mount

func (p *Driver) Mount(req *volume.MountRequest) (*volume.MountResponse, error)

Mount performs the mount operation. This will invoke the mount executable.

func (*Driver) Path

func (p *Driver) Path(req *volume.PathRequest) (*volume.PathResponse, error)

Path Request the path to the volume with the given volume_name. Mountpoint is blank until the Mount method is called.

func (*Driver) Remove

func (p *Driver) Remove(req *volume.RemoveRequest) error

Remove removes a specific volume.

func (*Driver) ServeUnix

func (p *Driver) ServeUnix()

ServeUnix makes the handler to listen for requests in a unix socket. It also creates the socket filebased on the driver in the right directory for docker to read. If the "-h" argument is passed in on start up it will simply display the usage and terminate.

func (*Driver) Unmount

func (p *Driver) Unmount(req *volume.UnmountRequest) error

Unmount uses the system call Unmount to do the unmounting. If the umount call comes with EINVAL then this will log the error but will not fail the operation.

type DriverCallback

type DriverCallback interface {
	// Validates the creation request to make sure the options are all valid.
	Validate(req *volume.CreateRequest) error

	// MountOptions specifies the options to be added to the mount process
	MountOptions(req *volume.CreateRequest) []string

	// PreMount is called before the mount occurs.  This can be used to deal with scenarios where the credential data need to be unlocked.
	PreMount(req *volume.MountRequest) error

	// PostMount is deferred after PreMount occurs.
	PostMount(req *volume.MountRequest)

	volume.Driver
}

DriverCallback inteface specifies methods that need to be implemented.

Jump to

Keyboard shortcuts

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