smengcl commented on code in PR #11426:
URL: https://github.com/apache/ozone/pull/11426#discussion_r4255597733
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -498,6 +530,6 @@ private void handleRuntimeException(RuntimeException ex,
S3RequestContext contex
private boolean shouldIncludeOwnerInListResponse() {
int listType = queryParams().getInt(QueryParams.LIST_TYPE, 1);
boolean fetchOwner = queryParams().getBoolean(QueryParams.FETCH_OWNER,
false);
- return listType != 2 || fetchOwner;
+ return isListObjectVersions() || listType != 2 || fetchOwner;
Review Comment:
Thanks @Gargi-jais11 .
`fetch-owner` exists only on ListObjectsV2. ListObjectVersions has no such
parameter (see the request syntax on the linked page;
`ListObjectVersionsRequest` in the AWS SDK has no `fetchOwner` either), and
every `Version` in the sample responses there carries `Owner`. The
ListObjectsV2 reference is where the "owner is not present by default" rule
comes from.
Other implementations agree: MinIO and Ceph RGW both return `Owner`
unconditionally in the versions listing and only check `fetch-owner` on the V2
path. ceph/s3-tests relies on it too: `test_bucket_list_return_data_versioning`
calls `list_object_versions(Bucket=...)` and asserts `obj['Owner']['ID']`.
So I think always returning `Owner` is right here.
`listObjectVersionsIgnoresListObjectsV2Params` covers it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]