driver

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	Config *config.Config
	Log    *logrus.Entry
}

Args - params to create a new driver

type Driver

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

Driver - Docker Volume driver for NS, it implements methods /VolumeDriver.*: https://docs.docker.com/v17.09/engine/extend/plugins_volume/

func New

func New(args Args) (*Driver, error)

New - create new NS volume driver

func (*Driver) Capabilities

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

Capabilities returns plugin capabilities

func (*Driver) Create

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

Create Docker volume, created filesystem on NS

func (*Driver) Get

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

Get volume by its name, find out if NS has this filesystem created

func (*Driver) List

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

List lists all shared filesystems on NS as volumes

func (*Driver) Mount

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

Mount mounts NS share to a Docker host, then bind-mounts this share to another folder for particular container.

Working model: NS share "S" <---> Docker host folder "H" (mount -t nfs S H) <--+--> Mount for container A (mount -o bind H A)

|--> Mount for container B (mount -o bind H B)
|--> Mount for container C (mount -o bind H C)
`--> Mount for container D (mount -o bind H D)

On host all 'mount' happen under: /var/lib/docker/plugins/<PLUGIN_ID>/propagated-mount/volume/<VOLUME_NAME> - mounted NS share /var/lib/docker/plugins/<PLUGIN_ID>/propagated-mount/bind/<VOLUME_NAME>-<CONTAINER_ID> - bind container(s) to share

Inside driver's container all 'mount' happen under: /mnt/nexentastor-docker-volume-plugin/volume/<VOLUME_NAME> - mounted NS share /mnt/nexentastor-docker-volume-plugin/bind/<VOLUME_NAME>-<CONTAINER_ID> - bind container(s) to share `/mnt/nexentastor-docker-volume-plugin` is a "propagatedmount" parameter in the `config.json`.

func (*Driver) Path

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

Path returns volume mount point

func (*Driver) Remove

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

Remove removes Docker volume. This method does NOT remove filesystem from NS, `docker volume list` will still show the volume in the list while filesystem is shared on NS.

func (*Driver) Unmount

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

Unmount un-mounts container bind-mount and also un-mounts NS filesystem mount if no one is using it

Jump to

Keyboard shortcuts

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