Skip to content

Commit 3b84951

Browse files
authored
Merge pull request #93 from getshifter/b-efs_subdir
fix mounting efs with subdirectory.
2 parents 07ecbb7 + b054a06 commit 3b84951

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

netshare/drivers/efs.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ package drivers
22

33
import (
44
"fmt"
5-
log "github.com/Sirupsen/logrus"
6-
"github.com/docker/go-plugins-helpers/volume"
75
"os"
8-
"strings"
96
"regexp"
7+
"strings"
8+
9+
log "github.com/Sirupsen/logrus"
10+
"github.com/docker/go-plugins-helpers/volume"
1011
)
1112

1213
const (
@@ -101,15 +102,14 @@ func (e efsDriver) Unmount(r volume.UnmountRequest) volume.Response {
101102
}
102103

103104
func (e efsDriver) fixSource(name, id string) string {
104-
reg, _ := regexp.Compile("(fs-[0-9a-f]+)$")
105-
name = reg.FindString(name)
106-
107105
if e.mountm.HasOption(name, ShareOpt) {
108106
name = e.mountm.GetOption(name, ShareOpt)
109107
}
110108

111109
v := strings.Split(name, "/")
112-
uri := v[0]
110+
reg, _ := regexp.Compile("(fs-[0-9a-f]+)$")
111+
uri := reg.FindString(v[0])
112+
113113
if e.resolve {
114114
uri = fmt.Sprintf(EfsTemplateURI, e.availzone, v[0], e.region)
115115
if i, ok := e.dnscache[uri]; ok {

0 commit comments

Comments
 (0)