mount: outsideContainerClusterMode changed to use volume server publicUrl

This commit is contained in:
Chris Lu
2020-10-11 20:42:15 -07:00
parent 723ae11db4
commit 7704469d29
2 changed files with 4 additions and 19 deletions

View File

@@ -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
if wfs.option.OutsideContainerClusterMode {
return location.PublicUrl
}
commaIndex := strings.Index(location.Url, ":")
if commaIndex < 0 {
return location.Url
}
filerCommaIndex := strings.Index(wfs.option.FilerGrpcAddress, ":")
return fmt.Sprintf("%s:%s", wfs.option.FilerGrpcAddress[:filerCommaIndex], location.Url[commaIndex+1:])
return location.Url
}