Skip to content

Commit

Permalink
Merge pull request #93 from getshifter/b-efs_subdir
Browse files Browse the repository at this point in the history
fix mounting efs with subdirectory.
  • Loading branch information
gondor authored Jan 9, 2017
2 parents 07ecbb7 + b054a06 commit 3b84951
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions netshare/drivers/efs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package drivers

import (
"fmt"
log "github.com/Sirupsen/logrus"
"github.com/docker/go-plugins-helpers/volume"
"os"
"strings"
"regexp"
"strings"

log "github.com/Sirupsen/logrus"
"github.com/docker/go-plugins-helpers/volume"
)

const (
Expand Down Expand Up @@ -101,15 +102,14 @@ 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)
}

v := strings.Split(name, "/")
uri := v[0]
reg, _ := regexp.Compile("(fs-[0-9a-f]+)$")
uri := reg.FindString(v[0])

if e.resolve {
uri = fmt.Sprintf(EfsTemplateURI, e.availzone, v[0], e.region)
if i, ok := e.dnscache[uri]; ok {
Expand Down

0 comments on commit 3b84951

Please sign in to comment.