From c3f4656e90bdef9276a6b810ac3cb036359edb08 Mon Sep 17 00:00:00 2001 From: Denis Savenko Date: Mon, 10 Oct 2016 18:09:34 +0300 Subject: [PATCH] EFS volume id extractor added for compatibility with docker-compose --- netshare/drivers/efs.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netshare/drivers/efs.go b/netshare/drivers/efs.go index 5a86e32..2af1926 100644 --- a/netshare/drivers/efs.go +++ b/netshare/drivers/efs.go @@ -6,6 +6,7 @@ import ( "github.com/docker/go-plugins-helpers/volume" "os" "strings" + "regexp" ) const ( @@ -100,6 +101,9 @@ func (e efsDriver) Unmount(r volume.UnmountRequest) volume.Response { } func (e efsDriver) fixSource(name, id string) string { + reg, _ := regexp.Compile("(fs-[0-9a-f]+)$") + name = reg.FindString(name) + if e.mountm.HasOption(name, ShareOpt) { name = e.mountm.GetOption(name, ShareOpt) }