From ef652083751e3e63e76f1011f07b5aae9cf8c102 Mon Sep 17 00:00:00 2001 From: Sylvain Rivierre Date: Fri, 8 Jul 2016 18:01:50 +0200 Subject: [PATCH] Fix use of mount path for efs driver --- netshare/drivers/efs.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/netshare/drivers/efs.go b/netshare/drivers/efs.go index b29c329..6c94f55 100644 --- a/netshare/drivers/efs.go +++ b/netshare/drivers/efs.go @@ -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)