From: Matt Benjamin Date: Sat, 16 Feb 2019 22:06:28 +0000 (-0500) Subject: rgw: lifecycle days may be 0 X-Git-Tag: v14.2.5~109^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=75787199918c374ae7f52d8979f9fd8dfc291161;p=ceph.git rgw: lifecycle days may be 0 This appears to be true in general, though the only examples in AWS documentation appear to be in Transition rules, a number are found here: https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-configuration-examples.html Fixes: https://tracker.ceph.com/issues/38389 Signed-off-by: Matt Benjamin (cherry picked from commit b050312adf6b51d3cfa64c155f00880158058249) --- diff --git a/src/rgw/rgw_lc.h b/src/rgw/rgw_lc.h index d662173d9ff..df101e8370e 100644 --- a/src/rgw/rgw_lc.h +++ b/src/rgw/rgw_lc.h @@ -85,7 +85,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