-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8422 list multipart uploads #8531
Changes from 2 commits
e7fb7b8
cd5b80d
299032a
d9ea540
7b1500d
08ad93c
1f7bf56
2fbe42a
11f8d46
08977ec
749f305
7d121bd
e04cd1b
dfc6699
8aa34f5
f8c8215
cff37f2
219d4f4
0a37251
52ef352
ea30b22
62f9e44
1bdd16f
644a390
22c1756
3d9225e
b1d588b
f6d95c7
9a4c5e1
033784a
2542855
c74b714
deb1fd3
5922ef8
2f740f4
f91771d
b3e5884
5a20568
62f8bbb
8f55605
645e5cf
4ecb691
58961d1
fa64a69
82f74a3
dfbee5c
d21b831
8ea2f8e
eaf8972
ad126b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,9 @@ import ( | |
|
||
const ( | ||
ListObjectMaxKeys = 1000 | ||
maxUploadsRange = 2147483647 | ||
minUploadsRange = 0 | ||
maxUploadsListMPU = 2147483647 | ||
minUploadsListMPU = 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
// defaultBucketLocation used to identify if we need to specify the location constraint | ||
defaultBucketLocation = "us-east-1" | ||
QueryParamMaxUploads = "max-uploads" | ||
|
@@ -425,13 +426,11 @@ func handleListMultipartUploads(w http.ResponseWriter, req *http.Request, o *Rep | |
opts := block.ListMultipartUploadsOpts{} | ||
if maxUploadsStr != "" { | ||
maxUploads, err := strconv.ParseInt(maxUploadsStr, 10, 32) | ||
if err != nil || maxUploads < minUploadsRange || maxUploads > maxUploadsRange { | ||
o.Log(req).WithField("maxUploadsStr", maxUploadsStr). | ||
WithError(err).Error("malformed query parameter 'maxUploadsStr'") | ||
maxUploads32 := int32(maxUploads) | ||
if err != nil || maxUploads < minUploadsListMPU || maxUploads > maxUploadsListMPU { | ||
_ = o.EncodeError(w, req, err, gatewayerrors.Codes.ToAPIErr(gatewayerrors.ErrInvalidMaxUploads)) | ||
return | ||
} | ||
maxUploads32 := int32(maxUploads) | ||
opts.MaxUploads = &maxUploads32 | ||
} | ||
if uploadIDMarker != "" { | ||
|
@@ -476,6 +475,7 @@ func handleListMultipartUploads(w http.ResponseWriter, req *http.Request, o *Rep | |
NextKeyMarker: aws.StringValue(mpuResp.NextKeyMarker), | ||
NextUploadIDMarker: aws.StringValue(mpuResp.NextUploadIDMarker), | ||
IsTruncated: mpuResp.IsTruncated, | ||
MaxUploads: aws.Int32Value(mpuResp.MaxUploads), | ||
} | ||
o.EncodeResponse(w, req, resp, http.StatusOK) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test should run only on S3 - I assume that the tests didn't pass for azure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @idanovo asked, these tests run for other adapters as well, only until the the first list mpu request in which they are expected to fail. then they are being skipped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nopcoder I wanted to make sure we get the right error for other block stores
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but I don't understand how it works as we currently do not support this flow for all adapters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I see the check down the code of this function - but why do we even start to upload if we can't test it on non-s3 implementation?
we have a different test to check missing functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be tested in another test.
@ItamarYuran, my suggestion is to:
TestListMultipartUploads
TestListMultipartUploadsUnsupported
back to t.skipp with a proper messageif blockStoreType != "s3"
TestListMultipartUploadsUnsupported
name to indicate it checks only unsupported parametersif blockStoreType != "s3"
@nopcoder WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think that the latest change include the above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't