From: Chang Liu Date: Thu, 15 Aug 2019 07:48:05 +0000 (+0800) Subject: rgw: DefaultRetention requires either Days or Years X-Git-Tag: v15.1.0~1501^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a4128494f55b8ad3b9fb122e5d2f2064de970f8a;p=ceph.git rgw: DefaultRetention requires either Days or Years Fixes: https://tracker.ceph.com/issues/41838 Signed-off-by: Chang Liu --- diff --git a/src/rgw/rgw_object_lock.h b/src/rgw/rgw_object_lock.h index 0bdbea5568d..e84dd8d4d22 100644 --- a/src/rgw/rgw_object_lock.h +++ b/src/rgw/rgw_object_lock.h @@ -109,7 +109,10 @@ public: } bool retention_period_valid() const { - return (get_years() > 0 || get_days() > 0); + // DefaultRetention requires either Days or Years. + // You can't specify both at the same time. + // see https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTObjectLockConfiguration.html + return get_years() > 0 != get_days() > 0; } bool has_rule() const {