Split and mock etcd_state_client_t for testing

This commit is contained in:
Vitaliy Filippov
2026-06-13 19:56:06 +03:00
parent 26fb08d7da
commit ef0e61be1b
23 changed files with 848 additions and 572 deletions
+1 -3
View File
@@ -3,7 +3,7 @@
#include "osd.h"
#include "str_util.h"
#include "etcd_state_client.h"
#include "etcd_state_client_http.h"
#include "http_client.h"
#include "osd_rmw.h"
#include "addr_util.h"
@@ -16,7 +16,6 @@
// Peer connection is lost -> Reload connection data -> Try to reconnect
void osd_t::init_cluster()
{
st_cli = std::make_unique<etcd_state_client_t>();
if (!st_cli->address_count())
{
init_blockstore(NULL);
@@ -65,7 +64,6 @@ void osd_t::init_cluster()
}
else
{
st_cli->tfd = tfd;
st_cli->log_level = log_level;
st_cli->on_change_osd_state_hook = [this](osd_num_t peer_osd) { on_change_osd_state_hook(peer_osd); };
st_cli->on_change_pool_config_hook = [this]() { on_change_pool_config_hook(); };