]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: DefaultRetention requires either Days or Years
authorChang Liu <liuchang0812@gmail.com>
Thu, 15 Aug 2019 07:48:05 +0000 (15:48 +0800)
committerPaul Emmerich <paul.emmerich@croit.io>
Thu, 3 Oct 2019 09:30:46 +0000 (11:30 +0200)
Fixes: https://tracker.ceph.com/issues/41838
Signed-off-by: Chang Liu <liuchang0812@gmail.com>
(cherry picked from commit a4128494f55b8ad3b9fb122e5d2f2064de970f8a)

src/rgw/rgw_object_lock.h

index 4724907d1b056781bf0c89bcea3b374a6018b4e5..ccd48b90667482f83859c9e55d3069b872ce1f10 100644 (file)
@@ -106,7 +106,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 {