]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: 'sync status' shows enabled/disabled zonegroup features
authorCasey Bodley <cbodley@redhat.com>
Wed, 3 Mar 2021 21:55:23 +0000 (16:55 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Tue, 1 Feb 2022 21:31:01 +0000 (16:31 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_admin.cc

index bc0699aeed1edac449c6f303b8dd154cf465308a..6443ef4c4d64e2d6ca8666331af7087a2cfcb6dc 100644 (file)
@@ -2419,6 +2419,16 @@ static void tab_dump(const string& header, int width, const list<string>& entrie
   }
 }
 
+// return features that are supported but not enabled
+static auto get_disabled_features(const rgw::zone_features::set& enabled) {
+  auto features = rgw::zone_features::set{rgw::zone_features::supported.begin(),
+                                          rgw::zone_features::supported.end()};
+  for (const auto& feature : enabled) {
+    features.erase(feature);
+  }
+  return features;
+}
+
 
 static void sync_status(Formatter *formatter)
 {
@@ -2432,6 +2442,11 @@ static void sync_status(Formatter *formatter)
   cout << std::setw(width) << "zonegroup" << std::setw(1) << " " << zonegroup.get_id() << " (" << zonegroup.get_name() << ")" << std::endl;
   cout << std::setw(width) << "zone" << std::setw(1) << " " << zone.id << " (" << zone.name << ")" << std::endl;
 
+  cout << std::setw(width) << "zonegroup features enabled: " << zonegroup.enabled_features << std::endl;
+  if (auto d = get_disabled_features(zonegroup.enabled_features); !d.empty()) {
+    cout << std::setw(width) << "                   disabled: " << d << std::endl;
+  }
+
   list<string> md_status;
 
   if (store->is_meta_master()) {