aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-06-11 09:50:59 -0700
committerchrislu <chris.lu@gmail.com>2022-06-11 09:50:59 -0700
commit61b8c9c361fea730c93f88bb97279a3d6664fa4e (patch)
tree4b30c900d8b9182b49c07c8e5982aeb7f9cb5a5c
parent9f8b72a54d8c97db5963f5204e2857e93bf22612 (diff)
downloadseaweedfs-61b8c9c361fea730c93f88bb97279a3d6664fa4e.tar.xz
seaweedfs-61b8c9c361fea730c93f88bb97279a3d6664fa4e.zip
remote object store gateway: disable tagging for backblaze
-rw-r--r--weed/remote_storage/s3/aliyun.go3
-rw-r--r--weed/remote_storage/s3/backblaze.go3
-rw-r--r--weed/remote_storage/s3/baidu.go3
-rw-r--r--weed/remote_storage/s3/contabo.go3
-rw-r--r--weed/remote_storage/s3/filebase.go3
-rw-r--r--weed/remote_storage/s3/s3_storage_client.go20
-rw-r--r--weed/remote_storage/s3/storj.go3
-rw-r--r--weed/remote_storage/s3/tencent.go3
-rw-r--r--weed/remote_storage/s3/wasabi.go3
9 files changed, 28 insertions, 16 deletions
diff --git a/weed/remote_storage/s3/aliyun.go b/weed/remote_storage/s3/aliyun.go
index 864e4d5d0..d6923aa6b 100644
--- a/weed/remote_storage/s3/aliyun.go
+++ b/weed/remote_storage/s3/aliyun.go
@@ -24,7 +24,8 @@ func (s AliyunRemoteStorageMaker) HasBucket() bool {
func (s AliyunRemoteStorageMaker) Make(conf *remote_pb.RemoteConf) (remote_storage.RemoteStorageClient, error) {
client := &s3RemoteStorageClient{
- conf: conf,
+ supportTagging: true,
+ conf: conf,
}
accessKey := util.Nvl(conf.AliyunAccessKey, os.Getenv("ALICLOUD_ACCESS_KEY_ID"))
secretKey := util.Nvl(conf.AliyunSecretKey, os.Getenv("ALICLOUD_ACCESS_KEY_SECRET"))
diff --git a/weed/remote_storage/s3/backblaze.go b/weed/remote_storage/s3/backblaze.go
index ca24e85d2..09a033f8c 100644
--- a/weed/remote_storage/s3/backblaze.go
+++ b/weed/remote_storage/s3/backblaze.go
@@ -22,7 +22,8 @@ func (s BackBlazeRemoteStorageMaker) HasBucket() bool {
func (s BackBlazeRemoteStorageMaker) Make(conf *remote_pb.RemoteConf) (remote_storage.RemoteStorageClient, error) {
client := &s3RemoteStorageClient{
- conf: conf,
+ supportTagging: false,
+ conf: conf,
}
config := &aws.Config{
Endpoint: aws.String(conf.BackblazeEndpoint),
diff --git a/weed/remote_storage/s3/baidu.go b/weed/remote_storage/s3/baidu.go
index 6021c9330..23bce409e 100644
--- a/weed/remote_storage/s3/baidu.go
+++ b/weed/remote_storage/s3/baidu.go
@@ -24,7 +24,8 @@ func (s BaiduRemoteStorageMaker) HasBucket() bool {
func (s BaiduRemoteStorageMaker) Make(conf *remote_pb.RemoteConf) (remote_storage.RemoteStorageClient, error) {
client := &s3RemoteStorageClient{
- conf: conf,
+ supportTagging: true,
+ conf: conf,
}
accessKey := util.Nvl(conf.BaiduAccessKey, os.Getenv("BDCLOUD_ACCESS_KEY"))
secretKey := util.Nvl(conf.BaiduSecretKey, os.Getenv("BDCLOUD_SECRET_KEY"))
diff --git a/weed/remote_storage/s3/contabo.go b/weed/remote_storage/s3/contabo.go
index 4d8528407..2e85422dc 100644
--- a/weed/remote_storage/s3/contabo.go
+++ b/weed/remote_storage/s3/contabo.go
@@ -25,7 +25,8 @@ func (s ContaboRemoteStorageMaker) HasBucket() bool {
func (s ContaboRemoteStorageMaker) Make(conf *remote_pb.RemoteConf) (remote_storage.RemoteStorageClient, error) {
client := &s3RemoteStorageClient{
- conf: conf,
+ supportTagging: true,
+ conf: conf,
}
accessKey := util.Nvl(conf.ContaboAccessKey, os.Getenv("ACCESS_KEY"))
secretKey := util.Nvl(conf.ContaboSecretKey, os.Getenv("SECRET_KEY"))
diff --git a/weed/remote_storage/s3/filebase.go b/weed/remote_storage/s3/filebase.go
index fd5200f1a..23787e0e2 100644
--- a/weed/remote_storage/s3/filebase.go
+++ b/weed/remote_storage/s3/filebase.go
@@ -25,7 +25,8 @@ func (s FilebaseRemoteStorageMaker) HasBucket() bool {
func (s FilebaseRemoteStorageMaker) Make(conf *remote_pb.RemoteConf) (remote_storage.RemoteStorageClient, error) {
client := &s3RemoteStorageClient{
- conf: conf,
+ supportTagging: true,
+ conf: conf,
}
accessKey := util.Nvl(conf.FilebaseAccessKey, os.Getenv("AWS_ACCESS_KEY_ID"))
secretKey := util.Nvl(conf.FilebaseSecretKey, os.Getenv("AWS_SECRET_ACCESS_KEY"))
diff --git a/weed/remote_storage/s3/s3_storage_client.go b/weed/remote_storage/s3/s3_storage_client.go
index 735dadf34..b3c3cb3aa 100644
--- a/weed/remote_storage/s3/s3_storage_client.go
+++ b/weed/remote_storage/s3/s3_storage_client.go
@@ -31,7 +31,8 @@ func (s s3RemoteStorageMaker) HasBucket() bool {
func (s s3RemoteStorageMaker) Make(conf *remote_pb.RemoteConf) (remote_storage.RemoteStorageClient, error) {
client := &s3RemoteStorageClient{
- conf: conf,
+ supportTagging: true,
+ conf: conf,
}
config := &aws.Config{
Region: aws.String(conf.S3Region),
@@ -59,11 +60,12 @@ func (s s3RemoteStorageMaker) Make(conf *remote_pb.RemoteConf) (remote_storage.R
}
type s3RemoteStorageClient struct {
- conf *remote_pb.RemoteConf
- conn s3iface.S3API
+ conf *remote_pb.RemoteConf
+ conn s3iface.S3API
+ supportTagging bool
}
-var _ = remote_storage.RemoteStorageClient(&s3RemoteStorageClient{})
+var _ = remote_storage.RemoteStorageClient(&s3RemoteStorageClient{supportTagging: true})
func (s *s3RemoteStorageClient) Traverse(remote *remote_pb.RemoteStorageLocation, visitFn remote_storage.VisitFunc) (err error) {
@@ -158,11 +160,13 @@ func (s *s3RemoteStorageClient) WriteFile(loc *remote_pb.RemoteStorageLocation,
// process tagging
tags := ""
- for k, v := range entry.Extended {
- if len(tags) > 0 {
- tags = tags + "&"
+ if s.supportTagging {
+ for k, v := range entry.Extended {
+ if len(tags) > 0 {
+ tags = tags + "&"
+ }
+ tags = tags + k + "=" + string(v)
}
- tags = tags + k + "=" + string(v)
}
// Upload the file to S3.
diff --git a/weed/remote_storage/s3/storj.go b/weed/remote_storage/s3/storj.go
index 9e902515a..2de7ad357 100644
--- a/weed/remote_storage/s3/storj.go
+++ b/weed/remote_storage/s3/storj.go
@@ -24,7 +24,8 @@ func (s StorjRemoteStorageMaker) HasBucket() bool {
func (s StorjRemoteStorageMaker) Make(conf *remote_pb.RemoteConf) (remote_storage.RemoteStorageClient, error) {
client := &s3RemoteStorageClient{
- conf: conf,
+ supportTagging: true,
+ conf: conf,
}
accessKey := util.Nvl(conf.StorjAccessKey, os.Getenv("AWS_ACCESS_KEY_ID"))
secretKey := util.Nvl(conf.StorjSecretKey, os.Getenv("AWS_SECRET_ACCESS_KEY"))
diff --git a/weed/remote_storage/s3/tencent.go b/weed/remote_storage/s3/tencent.go
index b7711b956..ab027a1f4 100644
--- a/weed/remote_storage/s3/tencent.go
+++ b/weed/remote_storage/s3/tencent.go
@@ -24,7 +24,8 @@ func (s TencentRemoteStorageMaker) HasBucket() bool {
func (s TencentRemoteStorageMaker) Make(conf *remote_pb.RemoteConf) (remote_storage.RemoteStorageClient, error) {
client := &s3RemoteStorageClient{
- conf: conf,
+ supportTagging: true,
+ conf: conf,
}
accessKey := util.Nvl(conf.TencentSecretId, os.Getenv("COS_SECRETID"))
secretKey := util.Nvl(conf.TencentSecretKey, os.Getenv("COS_SECRETKEY"))
diff --git a/weed/remote_storage/s3/wasabi.go b/weed/remote_storage/s3/wasabi.go
index 29cdf7395..64dd0bbf2 100644
--- a/weed/remote_storage/s3/wasabi.go
+++ b/weed/remote_storage/s3/wasabi.go
@@ -24,7 +24,8 @@ func (s WasabiRemoteStorageMaker) HasBucket() bool {
func (s WasabiRemoteStorageMaker) Make(conf *remote_pb.RemoteConf) (remote_storage.RemoteStorageClient, error) {
client := &s3RemoteStorageClient{
- conf: conf,
+ supportTagging: true,
+ conf: conf,
}
accessKey := util.Nvl(conf.WasabiAccessKey)
secretKey := util.Nvl(conf.WasabiSecretKey)