]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Add days0 to rgw lc transition 29937/head
authorOr Friedmann <ofriedma@redhat.com>
Tue, 27 Aug 2019 20:52:33 +0000 (23:52 +0300)
committerOr Friedmann <ofriedma@redhat.com>
Mon, 14 Oct 2019 16:39:48 +0000 (19:39 +0300)
Currently lc does not get days 0 for transition, but by aws s3 spec it should

Fixes: https://tracker.ceph.com/issues/38389
Signed-off-by: Or Friedmann <ofriedma@redhat.com>
src/rgw/rgw_lc.cc
src/rgw/rgw_lc.h

index b9702318d924a3feb69e441c1386ef45b98c4f4b..8cecf0feb6f365ab82bbee2c0e42e73434788c90 100644 (file)
@@ -863,7 +863,7 @@ public:
 
     auto mtime = get_effective_mtime(oc);
     bool is_expired;
-    if (transition.days <= 0) {
+    if (transition.days < 0) {
       if (transition.date == boost::none) {
         ldout(oc.cct, 20) << __func__ << "(): key=" << o.key << ": no transition day/date set in rule, skipping" << dendl;
         return false;
index 8956cc9447f2d5c16edb44fd9325419a0a031ea8..734132bfe76ff08c34c51d91c70984b9b90f6ed3 100644 (file)
@@ -130,7 +130,7 @@ public:
   bool valid() const {
     if (!days.empty() && !date.empty()) {
       return false;
-    } else if (!days.empty() && get_days() <=0) {
+    } else if (!days.empty() && get_days() < 0) {
       return false;
     }
     //We've checked date in xml parsing