From c82b856c4427d09a43102ee4c9a5a101d9875c9e Mon Sep 17 00:00:00 2001 From: Daphne Nhuch Date: Thu, 8 Feb 2024 18:18:21 -0500 Subject: [PATCH] cleanup --- services/s3/itest/s3_test.go | 7 +++---- services/s3/s3.go | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/services/s3/itest/s3_test.go b/services/s3/itest/s3_test.go index 96524a6..dd24122 100644 --- a/services/s3/itest/s3_test.go +++ b/services/s3/itest/s3_test.go @@ -59,14 +59,13 @@ func TestMultipartUpload(t *testing.T) { kmsKey := "custom-kms-key" key := "test-key" kmsContext := "foo=bar" - tagging := "hello=world" upload, err := client.CreateMultipartUpload(ctx, &s3.CreateMultipartUploadInput{ Bucket: &bucket, Key: &key, ServerSideEncryption: types.ServerSideEncryptionAwsKms, SSEKMSKeyId: &kmsKey, SSEKMSEncryptionContext: &kmsContext, - Tagging: &tagging, + Tagging: aws.String("foo=bar"), }) if err != nil { t.Fatal(err) @@ -187,10 +186,10 @@ func TestMultipartUpload(t *testing.T) { if len(tags) != 1 { t.Fatal("bad tags", objectTagging.TagSet) } - if *tags[0].Key != "key" { + if *tags[0].Key != "foo" { t.Fatal("bad tag") } - if *tags[0].Value != "value" { + if *tags[0].Value != "bar" { t.Fatal("bad value") } } diff --git a/services/s3/s3.go b/services/s3/s3.go index ff43b58..486d2cc 100644 --- a/services/s3/s3.go +++ b/services/s3/s3.go @@ -547,6 +547,7 @@ func (s *S3) GetObjectTagging(input GetObjectTaggingInput) (*GetObjectTaggingOut }) } } + return tagging, nil } @@ -609,7 +610,6 @@ func (s *S3) CreateMultipartUpload(input CreateMultipartUploadInput) (*CreateMul } uploadId := base64.RawURLEncoding.EncodeToString(uuid.Must(uuid.NewV4()).Bytes()) - fmt.Sprintf("Daphne Tagging " + input.Tagging) s.multipartUploads[uploadId] = &multipartUpload{ Status: UploadStatusInProgress, Bucket: input.Bucket, @@ -764,6 +764,7 @@ func (s *S3) CompleteMultipartUpload(input CompleteMultipartUploadInput) (*Compl } object.ContentLength = totalContentLength object.ETag = etag(combinedMD5s) + "-" + strconv.Itoa(len(input.Part)) + object.Tagging = upload.Tagging s.buckets[input.Bucket].objects[input.Key] = &object upload.Status = UploadStatusCompleted