]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: LC expiration header should present midnight expiration date 31887/head
authorOr Friedmann <ofriedma@redhat.com>
Tue, 26 Nov 2019 13:34:29 +0000 (15:34 +0200)
committerOr Friedmann <ofriedma@redhat.com>
Tue, 26 Nov 2019 14:26:29 +0000 (16:26 +0200)
According to this one the expiration date should be midnight.
In obj_has_expired() it already does it but the expiration  header is still not midnight

Signed-off-by: Or Friedmann <ofriedma@redhat.com>
https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#intro-lifecycle-rules-actions

src/rgw/rgw_lc.cc

index 42062af0877b5545e9caac5db58c6a2a53d5e958..9470b1e7b783d96d3b0c8e75fdb01a2b4ac9b4ae 100644 (file)
@@ -1648,7 +1648,7 @@ std::string s3_expiration_header(
       if (rule_expiration.has_days()) {
        rule_expiration_date =
          boost::optional<ceph::real_time>(
-           mtime + make_timespan(rule_expiration.get_days()*24*60*60));
+           mtime + make_timespan(rule_expiration.get_days()*24*60*60 - ceph::real_clock::to_time_t(mtime)%(24*60*60) + 24*60*60));
       }
     }