]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add versioning info to radosgw-admin bucket stats output 54191/head
authorCory Snyder <csnyder@1111systems.com>
Wed, 4 Oct 2023 09:42:30 +0000 (05:42 -0400)
committerCory Snyder <csnyder@1111systems.com>
Wed, 25 Oct 2023 13:58:51 +0000 (09:58 -0400)
This allows admins to more easily identify whether a bucket
has versioning / object lock/ mfa enabled.

Fixes: https://tracker.ceph.com/issues/63092
Signed-off-by: Cory Snyder <csnyder@1111systems.com>
(cherry picked from commit 7752b9019d4444a499051669539cfd67b83e0d44)

src/rgw/driver/rados/rgw_bucket.cc

index 63ca0650a389f94f74c05ed3f9fe4ec23ed4b177..32cd1ccf95166c63dd45bd376a74d30bb9672aff 100644 (file)
@@ -1302,6 +1302,8 @@ static int bucket_stats(rgw::sal::Driver* driver,
     return ret;
   }
 
+  const RGWBucketInfo& bucket_info = bucket->get_info();
+
   const auto& index = bucket->get_info().get_current_index();
   if (is_layout_indexless(index)) {
     cerr << "error, indexless buckets do not maintain stats; bucket=" <<
@@ -1331,6 +1333,10 @@ static int bucket_stats(rgw::sal::Driver* driver,
   formatter->dump_string("id", bucket->get_bucket_id());
   formatter->dump_string("marker", bucket->get_marker());
   formatter->dump_stream("index_type") << bucket->get_info().layout.current_index.layout.type;
+  formatter->dump_bool("versioned", bucket_info.versioned());
+  formatter->dump_bool("versioning_enabled", bucket_info.versioning_enabled());
+  formatter->dump_bool("object_lock_enabled", bucket_info.obj_lock_enabled());
+  formatter->dump_bool("mfa_enabled", bucket_info.mfa_enabled());
   ::encode_json("owner", bucket->get_info().owner, formatter);
   formatter->dump_string("ver", bucket_ver);
   formatter->dump_string("master_ver", master_ver);