]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: create a ConfigStore
authorCasey Bodley <cbodley@redhat.com>
Thu, 1 Sep 2022 19:54:03 +0000 (15:54 -0400)
committerCasey Bodley <cbodley@redhat.com>
Wed, 28 Sep 2022 21:48:00 +0000 (17:48 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_admin.cc

index c692a9d4108271d5d1cc2e759b9473677442f0e6..116587d681c1eece7bfc047b83e00373b07e5ced 100644 (file)
@@ -63,6 +63,8 @@ extern "C" {
 #include "rgw_bucket_sync.h"
 #include "rgw_sync_checkpoint.h"
 #include "rgw_lua.h"
+#include "rgw_sal.h"
+#include "rgw_sal_config.h"
 
 #include "services/svc_sync_modules.h"
 #include "services/svc_cls.h"
@@ -4199,6 +4201,8 @@ int main(int argc, const char **argv)
   /* common_init_finish needs to be called after g_conf().set_val() */
   common_init_finish(g_ceph_context);
 
+  std::unique_ptr<rgw::sal::ConfigStore> cfgstore;
+
   if (args.empty()) {
     usage();
     exit(1);
@@ -4370,6 +4374,13 @@ int main(int argc, const char **argv)
 
     StoreManager::Config cfg = StoreManager::get_config(true, g_ceph_context);
 
+    auto config_store_type = g_conf().get_val<std::string>("rgw_config_store");
+    cfgstore = StoreManager::create_config_store(dpp(), config_store_type);
+    if (!cfgstore) {
+      cerr << "couldn't init config storage provider" << std::endl;
+      return EIO;
+    }
+
     if (raw_storage_op) {
       store = StoreManager::get_raw_storage(dpp(),
                                            g_ceph_context,
@@ -4388,7 +4399,7 @@ int main(int argc, const char **argv)
     }
     if (!store) {
       cerr << "couldn't init storage provider" << std::endl;
-      return 5; //EIO
+      return EIO;
     }
 
     /* Needs to be after the store is initialized.  Note, user could be empty here. */