aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-01-28 14:36:29 -0800
committerChris Lu <chris.lu@gmail.com>2021-01-28 14:36:29 -0800
commit990fa69bfeac65a72bec1539993e32633858c8f5 (patch)
tree00b90626c590534b64a581da8807117459b91ecb /weed/filesys
parent9292796ec2d8f796f3e9162fcd1362cba801e7e4 (diff)
downloadseaweedfs-990fa69bfeac65a72bec1539993e32633858c8f5.tar.xz
seaweedfs-990fa69bfeac65a72bec1539993e32633858c8f5.zip
add back AdjustedUrl() related code
Diffstat (limited to 'weed/filesys')
-rw-r--r--weed/filesys/wfs_filer_client.go7
-rw-r--r--weed/filesys/wfs_write.go2
2 files changed, 8 insertions, 1 deletions
diff --git a/weed/filesys/wfs_filer_client.go b/weed/filesys/wfs_filer_client.go
index e0d352a7b..ef4213af1 100644
--- a/weed/filesys/wfs_filer_client.go
+++ b/weed/filesys/wfs_filer_client.go
@@ -25,3 +25,10 @@ func (wfs *WFS) WithFilerClient(fn func(filer_pb.SeaweedFilerClient) error) erro
return err
}
+
+func (wfs *WFS) AdjustedUrl(location *filer_pb.Location) string {
+ if wfs.option.OutsideContainerClusterMode {
+ return location.PublicUrl
+ }
+ return location.Url
+}
diff --git a/weed/filesys/wfs_write.go b/weed/filesys/wfs_write.go
index dfe6e57a6..54e114013 100644
--- a/weed/filesys/wfs_write.go
+++ b/weed/filesys/wfs_write.go
@@ -44,7 +44,7 @@ func (wfs *WFS) saveDataAsChunk(fullPath util.FullPath) filer.SaveDataAsChunkFun
Url: resp.Url,
PublicUrl: resp.PublicUrl,
}
- host = loc.Url
+ host = wfs.AdjustedUrl(loc)
collection, replication = resp.Collection, resp.Replication
return nil