henry3260 opened a new pull request, #11003:
URL: https://github.com/apache/ozone/pull/11003

   ## What changes were proposed in this pull request?
   
   `PutBucketLifecycleConfiguration` returns the S3 error code `InvalidRequest` 
when a lifecycle rule is
   rejected, for example `Days: 0` or a `Date` that is not valid. AWS S3 
returns `InvalidArgument` for
   these, and s3-tests asserts on that exact code string.
   
   OM raises every lifecycle validation failure as 
`OMException.ResultCodes.INVALID_REQUEST`, and
   `S3ErrorTable.translateResultCode()` maps it to the same-named S3 code. That 
table is shared by all
   S3 endpoints, so it is left untouched; the remapping is applied on the 
lifecycle PUT path only, in
   `BucketLifecycleHandler.putBucketLifecycleConfiguration()` and
   `S3LifecycleConfiguration.toOmLifecycleConfiguration()`. Other result codes 
keep the shared
   translation. The HTTP status stays 400; only the error code string changes.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16150
   
   ## How was this patch tested?
   
   `TestS3LifecycleConfigurationPut`: existing assertions updated to 
`InvalidArgument`, plus new cases
   for `Days: 0` and for an empty `<Filter>` with an invalid `Date`.
   
   `mvn -pl :ozone-s3gateway test` — 723 tests, 0 failures. `mvn -pl 
:ozone-s3gateway checkstyle:check`
   passes.


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