Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
daphnenhuch-at committed Feb 8, 2024
1 parent e9eb6ae commit c82b856
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions services/s3/itest/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
}
}
Expand Down
3 changes: 2 additions & 1 deletion services/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ func (s *S3) GetObjectTagging(input GetObjectTaggingInput) (*GetObjectTaggingOut
})
}
}

return tagging, nil
}

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c82b856

Please sign in to comment.