Copilot commented on code in PR #11003:
URL: https://github.com/apache/ozone/pull/11003#discussion_r3765834985


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketLifecycleHandler.java:
##########
@@ -140,6 +140,14 @@ public Response 
putBucketLifecycleConfiguration(S3RequestContext context, String
     } catch (WebApplicationException ex) {
       throw S3ErrorTable.newError(S3ErrorTable.MALFORMED_XML, bucketName);
     } catch (OMException ex) {
+      // Both the rule validation in toOmLifecycleConfiguration and OM's own 
checks in
+      // setLifecycleConfiguration reject with INVALID_REQUEST, which the 
shared translation reports
+      // as InvalidRequest. S3 expects InvalidArgument for a rejected 
lifecycle configuration, so the
+      // whole path is remapped. This also covers OM-only checks such as 
bucket layout mismatch, which
+      // has no AWS equivalent.

Review Comment:
   The explanatory comment is a bit inaccurate: the code only remaps 
OMException ResultCodes.INVALID_REQUEST to S3 InvalidArgument, not “the whole 
path”. Also, toOmLifecycleConfiguration now throws INVALID_ARGUMENT directly 
for some validation failures, so it doesn’t always “reject with 
INVALID_REQUEST”. Consider rewording to match the actual behavior.



-- 
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]

Reply via email to