diff options
| author | hilimd <68371223+hilimd@users.noreply.github.com> | 2020-10-14 16:39:45 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-14 16:39:45 +0800 |
| commit | a91137579857a3ef40725dccda85f40d0ac77223 (patch) | |
| tree | ab389cfefe7796600aeaca14773992daf7746752 /weed/filesys/wfs_filer_client.go | |
| parent | 2ff727a32d6d879a49ff5848b592518c96bb6403 (diff) | |
| parent | 1069b325dd92b6a1b16a20290acc8129d5e19ef8 (diff) | |
| download | seaweedfs-a91137579857a3ef40725dccda85f40d0ac77223.tar.xz seaweedfs-a91137579857a3ef40725dccda85f40d0ac77223.zip | |
Merge pull request #26 from chrislusf/master
sync
Diffstat (limited to 'weed/filesys/wfs_filer_client.go')
| -rw-r--r-- | weed/filesys/wfs_filer_client.go | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/weed/filesys/wfs_filer_client.go b/weed/filesys/wfs_filer_client.go index 736df3588..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" @@ -26,15 +23,9 @@ func (wfs *WFS) WithFilerClient(fn func(filer_pb.SeaweedFilerClient) error) erro } -func (wfs *WFS) AdjustedUrl(hostAndPort string) string { - if !wfs.option.OutsideContainerClusterMode { - return hostAndPort - } - commaIndex := strings.Index(hostAndPort, ":") - if commaIndex < 0 { - return hostAndPort +func (wfs *WFS) AdjustedUrl(location *filer_pb.Location) string { + if wfs.option.OutsideContainerClusterMode { + return location.PublicUrl } - filerCommaIndex := strings.Index(wfs.option.FilerGrpcAddress, ":") - return fmt.Sprintf("%s:%s", wfs.option.FilerGrpcAddress[:filerCommaIndex], hostAndPort[commaIndex+1:]) - + return location.Url } |
