aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-10-11 20:42:15 -0700
committerChris Lu <chris.lu@gmail.com>2020-10-11 20:42:15 -0700
commit7704469d294c20df46d1cbd418754dfa9ace0add (patch)
tree6b2244c9a2540cdaceeaa26429341656b0745f58 /weed/filesys
parent723ae11db401b791925d99968ad53240c3259305 (diff)
downloadseaweedfs-7704469d294c20df46d1cbd418754dfa9ace0add.tar.xz
seaweedfs-7704469d294c20df46d1cbd418754dfa9ace0add.zip
mount: outsideContainerClusterMode changed to use volume server publicUrl
Diffstat (limited to 'weed/filesys')
-rw-r--r--weed/filesys/wfs_filer_client.go15
1 files changed, 3 insertions, 12 deletions
diff --git a/weed/filesys/wfs_filer_client.go b/weed/filesys/wfs_filer_client.go
index 8c30de3c5..096ee555f 100644
--- a/weed/filesys/wfs_filer_client.go
+++ b/weed/filesys/wfs_filer_client.go
@@ -1,9 +1,6 @@
package filesys
import (
- "fmt"
- "strings"
-
"google.golang.org/grpc"
"github.com/chrislusf/seaweedfs/weed/pb"
@@ -27,14 +24,8 @@ func (wfs *WFS) WithFilerClient(fn func(filer_pb.SeaweedFilerClient) error) erro
}
func (wfs *WFS) AdjustedUrl(location *filer_pb.Location) string {
- if !wfs.option.OutsideContainerClusterMode {
- return location.Url
- }
- commaIndex := strings.Index(location.Url, ":")
- if commaIndex < 0 {
- return location.Url
+ if wfs.option.OutsideContainerClusterMode {
+ return location.PublicUrl
}
- filerCommaIndex := strings.Index(wfs.option.FilerGrpcAddress, ":")
- return fmt.Sprintf("%s:%s", wfs.option.FilerGrpcAddress[:filerCommaIndex], location.Url[commaIndex+1:])
-
+ return location.Url
}