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

   ## What changes were proposed in this pull request?
   
   On `HeadObject`, S3 returns an `x-amz-expiration` header when a lifecycle 
expiration rule covers
   the object, naming the date it is scheduled for deletion and the rule that 
schedules it:
   
   ```
   x-amz-expiration: expiry-date="Fri, 21 Dec 2012 00:00:00 GMT", 
rule-id="Rule1"
   ```
   
   Ozone supports lifecycle expiration rules and already deletes the keys they 
cover, but S3 Gateway
   never emitted this header, so clients cannot read a key's expiration 
metadata.
   
   S3G now reads the bucket's lifecycle configuration while serving `HEAD` and 
reports the earliest
   expiry among the enabled expiration rules that cover the key. A `Days` rule 
reports the key's
   modification time plus the configured days, rounded up to the next midnight 
UTC, as S3 does; a
   `Date` rule is reported as is.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16151
   
   ## How was this patch tested?
   
   * Added eight `TestObjectHead` cases: `Days` rule, `Date` rule, tag-filter 
rule, earliest of several
     matching rules, non-matching prefix, `Disabled` rule, 
`AbortIncompleteMultipartUpload`-only rule,
     and no lifecycle configuration. The `Date` case pins the exact header 
format against a fixed date.
   * `ozone-s3gateway` (754 tests) and `ozone-client` (118 tests) pass; 
checkstyle and RAT are clean.
   * Added two `bucketlifecycle.robot` cases (header present on a matching key, 
absent on a
     non-matching one). These were not run locally -- they need a compose 
cluster -- so they rely on CI.
   
   


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