diff options
| author | mervynzhang <sads@live.com> | 2023-05-19 21:39:25 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-19 06:39:25 -0700 |
| commit | 1ebb549f774e70fe29dfd91ec00e41c06cc10f1a (patch) | |
| tree | 4e4b978de7284fb251ae8b361922096fa5f8b22d /weed/remote_storage | |
| parent | a90b777ff4992ab59f4b1a94733b56f67ca9ddec (diff) | |
| download | seaweedfs-1ebb549f774e70fe29dfd91ec00e41c06cc10f1a.tar.xz seaweedfs-1ebb549f774e70fe29dfd91ec00e41c06cc10f1a.zip | |
support swift (#4480)
Diffstat (limited to 'weed/remote_storage')
| -rw-r--r-- | weed/remote_storage/s3/s3_storage_client.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/weed/remote_storage/s3/s3_storage_client.go b/weed/remote_storage/s3/s3_storage_client.go index 9b4e93088..980f970fb 100644 --- a/weed/remote_storage/s3/s3_storage_client.go +++ b/weed/remote_storage/s3/s3_storage_client.go @@ -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), }) |
