mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-22 03:08:51 +08:00
mount: outsideContainerClusterMode changed to use volume server publicUrl
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user