]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: DefaultRetention requires either Days or Years 29680/head
authorChang Liu <liuchang0812@gmail.com>
Thu, 15 Aug 2019 07:48:05 +0000 (15:48 +0800)
committerChang Liu <liuchang0812@gmail.com>
Mon, 16 Sep 2019 03:50:39 +0000 (11:50 +0800)
Fixes: https://tracker.ceph.com/issues/41838
Signed-off-by: Chang Liu <liuchang0812@gmail.com>
src/rgw/rgw_object_lock.h

index 0bdbea5568d7a6d307beabf0a987a370fa178cdf..e84dd8d4d22e0e5def514b88c8a0724d477a7093 100644 (file)
@@ -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 {