1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

When calling volume driver Mount, send opaque ID

This generates an ID string for calls to Mount/Unmount, allowing drivers
to differentiate between two callers of `Mount` and `Unmount`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff 2016-03-07 21:41:44 -05:00
parent 24a8de2b60
commit 2b6bc294fc
12 changed files with 77 additions and 29 deletions

View file

@ -97,6 +97,7 @@ func (pp *volumeDriverProxy) Path(name string) (mountpoint string, err error) {
type volumeDriverProxyMountRequest struct {
Name string
ID string
}
type volumeDriverProxyMountResponse struct {
@ -104,13 +105,14 @@ type volumeDriverProxyMountResponse struct {
Err string
}
func (pp *volumeDriverProxy) Mount(name string) (mountpoint string, err error) {
func (pp *volumeDriverProxy) Mount(name string, id string) (mountpoint string, err error) {
var (
req volumeDriverProxyMountRequest
ret volumeDriverProxyMountResponse
)
req.Name = name
req.ID = id
if err = pp.Call("VolumeDriver.Mount", req, &ret); err != nil {
return
}
@ -126,19 +128,21 @@ func (pp *volumeDriverProxy) Mount(name string) (mountpoint string, err error) {
type volumeDriverProxyUnmountRequest struct {
Name string
ID string
}
type volumeDriverProxyUnmountResponse struct {
Err string
}
func (pp *volumeDriverProxy) Unmount(name string) (err error) {
func (pp *volumeDriverProxy) Unmount(name string, id string) (err error) {
var (
req volumeDriverProxyUnmountRequest
ret volumeDriverProxyUnmountResponse
)
req.Name = name
req.ID = id
if err = pp.Call("VolumeDriver.Unmount", req, &ret); err != nil {
return
}