From d6246eadc4291bb89e6c6d6936ee37ae3e1a028c Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 1 Sep 2022 15:54:03 -0400 Subject: [PATCH] radosgw-admin: create a ConfigStore Signed-off-by: Casey Bodley --- src/rgw/rgw_admin.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index c692a9d4108..116587d681c 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -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 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("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. */ -- 2.47.3