aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/wfs_write.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-01-24 19:01:58 -0800
committerChris Lu <chris.lu@gmail.com>2021-01-24 19:01:58 -0800
commit00707ec00fb8016ac9ef8858a01a9784a6aee1a0 (patch)
treedfe313d9fead4bcdf741e52f7b6316d2da00d71b /weed/filesys/wfs_write.go
parent2c5eac5705c12b4dc0930d0a27478a73924b9e16 (diff)
downloadseaweedfs-00707ec00fb8016ac9ef8858a01a9784a6aee1a0.tar.xz
seaweedfs-00707ec00fb8016ac9ef8858a01a9784a6aee1a0.zip
mount: outsideContainerClusterMode proxy through filer
Running mount outside of the cluster would not need to expose all the volume servers to outside of the cluster. The chunk read and write will go through the filer.
Diffstat (limited to 'weed/filesys/wfs_write.go')
-rw-r--r--weed/filesys/wfs_write.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/weed/filesys/wfs_write.go b/weed/filesys/wfs_write.go
index 83e40e7f5..dfe6e57a6 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 = wfs.AdjustedUrl(loc)
+ host = loc.Url
collection, replication = resp.Collection, resp.Replication
return nil
@@ -53,6 +53,9 @@ func (wfs *WFS) saveDataAsChunk(fullPath util.FullPath) filer.SaveDataAsChunkFun
}
fileUrl := fmt.Sprintf("http://%s/%s", host, fileId)
+ if wfs.option.OutsideContainerClusterMode {
+ fileUrl = fmt.Sprintf("http://%s/?proxyChunkId=%s", wfs.option.FilerAddress, fileId)
+ }
uploadResult, err, data := operation.Upload(fileUrl, filename, wfs.option.Cipher, reader, false, "", nil, auth)
if err != nil {
glog.V(0).Infof("upload data %v to %s: %v", filename, fileUrl, err)