mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-01 01:40:44 +01:00
support swift (#4480)
This commit is contained in:
1 parent
a90b777ff4
commit
1ebb549f77
4 files changed
+142
-126
No files matched your search
@@ -160,13 +160,16 @@ func (s *s3RemoteStorageClient) WriteFile(loc *remote_pb.RemoteStorageLocation,
|
||||
|
||||
// process tagging
|
||||
tags := ""
|
||||
if s.supportTagging {
|
||||
var awsTags *string
|
||||
// openstack swift doesn't support s3 object tagging
|
||||
if s.conf.S3SupportTagging {
|
||||
for k, v := range entry.Extended {
|
||||
if len(tags) > 0 {
|
||||
tags = tags + "&"
|
||||
}
|
||||
tags = tags + k + "=" + string(v)
|
||||
}
|
||||
awsTags = aws.String(tags)
|
||||
}
|
||||
|
||||
// Upload the file to S3.
|
||||
@@ -174,7 +177,7 @@ func (s *s3RemoteStorageClient) WriteFile(loc *remote_pb.RemoteStorageLocation,
|
||||
Bucket: aws.String(loc.Bucket),
|
||||
Key: aws.String(loc.Path[1:]),
|
||||
Body: reader,
|
||||
Tagging: aws.String(tags),
|
||||
Tagging: awsTags,
|
||||
StorageClass: aws.String(s.conf.S3StorageClass),
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user