Skip to content

Commit

Permalink
Merge pull request #47 from slhad/master
Browse files Browse the repository at this point in the history
Fix use of mount path for efs driver
  • Loading branch information
gondor authored Jul 10, 2016
2 parents 22f77f6 + ef65208 commit 8604328
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions netshare/drivers/efs.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,30 +106,27 @@ func (e efsDriver) fixSource(r volume.Request) string {
}

v := strings.Split(name, "/")
uri := v[0]
if e.resolve {
uri := fmt.Sprintf(EfsTemplateURI, e.availzone, v[0], e.region)
uri = fmt.Sprintf(EfsTemplateURI, e.availzone, v[0], e.region)
if i, ok := e.dnscache[uri]; ok {
return mountSuffix(i)
uri = i
}

log.Debugf("Attempting to resolve: %s", uri)
if ip, err := e.resolver.Lookup(uri); err == nil {
log.Debugf("Resolved Addresses: %s", ip)
e.dnscache[uri] = ip
return mountSuffix(ip)
uri = ip
} else {
log.Errorf("Error during resolve: %s", err.Error())
return mountSuffix(uri)
uri = uri
}
}
v[0] = v[0] + ":"
v[0] = uri + ":"
return strings.Join(v, "/")
}

func mountSuffix(uri string) string {
return uri + ":/"
}

func (e efsDriver) mountVolume(source, dest string) error {
cmd := fmt.Sprintf("mount -t nfs4 %s %s", source, dest)
log.Debugf("exec: %s\n", cmd)
Expand Down

0 comments on commit 8604328

Please sign in to comment.