Skip to content

Commit

Permalink
is truncated
Browse files Browse the repository at this point in the history
  • Loading branch information
ItamarYuran committed Jan 28, 2025
1 parent 62f8bbb commit 8f55605
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions esti/s3_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,16 +347,17 @@ func TestListMultipartUploads(t *testing.T) {
require.Contains(t, keys, obj1)
require.Contains(t, keys, obj2)

// testing maxuploads - only first upload should return
maxUploads := aws.Int32(1)
output, err = s3Client.ListMultipartUploads(ctx, &s3.ListMultipartUploadsInput{Bucket: resp1.Bucket, MaxUploads: maxUploads})
require.NoError(t, err, "failed to list multipart uploads")
keys = extractUploadKeys(output)
require.Contains(t, keys, obj1)
require.NotContains(t, keys, obj2)

keyMarker := output.KeyMarker
uploadIDMarker := output.UploadIdMarker

// testing key marker and upload id marker for pagination. only records after marker should return
keyMarker := output.NextKeyMarker
uploadIDMarker := output.NextUploadIdMarker
output, err = s3Client.ListMultipartUploads(ctx, &s3.ListMultipartUploadsInput{Bucket: resp1.Bucket, MaxUploads: maxUploads, KeyMarker: keyMarker, UploadIdMarker: uploadIDMarker})
require.NoError(t, err, "failed to list multipart uploads")
keys = extractUploadKeys(output)
Expand Down
1 change: 1 addition & 0 deletions pkg/block/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ type ListMultipartUploadsResponse struct {
Uploads []types.MultipartUpload
NextUploadIDMarker *string
NextKeyMarker *string
IsTruncated bool
}

// CreateMultiPartUploadOpts contains optional arguments for
Expand Down
1 change: 1 addition & 0 deletions pkg/block/s3/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,7 @@ func (a *Adapter) ListMultipartUploads(ctx context.Context, obj block.ObjectPoin
Uploads: resp.Uploads,
NextUploadIDMarker: resp.NextUploadIdMarker,
NextKeyMarker: resp.NextKeyMarker,
IsTruncated: *resp.IsTruncated,
}
return &mpuResp, nil
}
Expand Down
1 change: 1 addition & 0 deletions pkg/gateway/operations/listobjects.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ func handleListMultipartUploads(w http.ResponseWriter, req *http.Request, o *Rep
Uploads: uploads,
NextKeyMarker: *mpuResp.NextKeyMarker,
NextUploadIDMarker: *mpuResp.NextUploadIDMarker,
IsTruncted: mpuResp.IsTruncated,
}
o.EncodeResponse(w, req, resp, http.StatusOK)
}
1 change: 1 addition & 0 deletions pkg/gateway/serde/xml.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ type ListMultipartUploadsOutput struct {
Uploads []Upload `xml:"Upload"`
NextKeyMarker string `xml:"NextKeyMarker"`
NextUploadIDMarker string `xml:"NextUploadIDMarker"`
IsTruncted bool `xml:"IsTruncted"`
}

type VersioningConfiguration struct {
Expand Down

0 comments on commit 8f55605

Please sign in to comment.