diff options
author | innokentii <innokentii@yandex-team.com> | 2023-06-05 19:00:57 +0300 |
---|---|---|
committer | innokentii <innokentii@yandex-team.com> | 2023-06-05 19:00:57 +0300 |
commit | 2d24328cd5b5498ae9cb26f6902b18b74e88836a (patch) | |
tree | b01b91dec99a023727e86c56449ad369a3304bac | |
parent | 79d3d8c5d3a70a80a337ab1cfde5a58f224d032e (diff) | |
download | ydb-2d24328cd5b5498ae9cb26f6902b18b74e88836a.tar.gz |
Fix get yaml config
fix get yaml config
-rw-r--r-- | ydb/core/cms/console/console__get_yaml_config.cpp | 17 | ||||
-rw-r--r-- | ydb/core/cms/console/console_ut_configs.cpp | 9 |
2 files changed, 16 insertions, 10 deletions
diff --git a/ydb/core/cms/console/console__get_yaml_config.cpp b/ydb/core/cms/console/console__get_yaml_config.cpp index 19de729ea7..2eb2f36293 100644 --- a/ydb/core/cms/console/console__get_yaml_config.cpp +++ b/ydb/core/cms/console/console__get_yaml_config.cpp @@ -35,16 +35,13 @@ public: Response->Record.MutableResponse()->set_version(Self->YamlVersion); if (!rowset.EndOfSet()) { - bool dropped = rowset.template GetValue<Schema::YamlConfig::Dropped>(); - if (!dropped) { - auto config = rowset.template GetValue<Schema::YamlConfig::Config>(); - Response->Record.MutableResponse()->set_config(config); - - for (auto &[id, cfg] : Self->VolatileYamlConfigs) { - auto *config = Response->Record.MutableResponse()->add_volatile_configs(); - config->set_id(id); - config->set_config(cfg); - } + auto config = rowset.template GetValue<Schema::YamlConfig::Config>(); + Response->Record.MutableResponse()->set_config(config); + + for (auto &[id, cfg] : Self->VolatileYamlConfigs) { + auto *config = Response->Record.MutableResponse()->add_volatile_configs(); + config->set_id(id); + config->set_config(cfg); } } diff --git a/ydb/core/cms/console/console_ut_configs.cpp b/ydb/core/cms/console/console_ut_configs.cpp index c6608adb5e..9fcd86906e 100644 --- a/ydb/core/cms/console/console_ut_configs.cpp +++ b/ydb/core/cms/console/console_ut_configs.cpp @@ -3954,6 +3954,15 @@ Y_UNIT_TEST_SUITE(TConsoleInMemoryConfigSubscriptionTests) { UNIT_ASSERT_VALUES_EQUAL(notification->Get()->Record.VolatileConfigsSize(), 1); UNIT_ASSERT_VALUES_EQUAL(notification->Get()->Record.GetVolatileConfigs()[0].GetConfig(), VOLATILE_YAML_CONFIG_1_1); + runtime.SendToConsole(new TEvConsole::TEvGetAllConfigsRequest()); + TAutoPtr<IEventHandle> handle; + auto configs = runtime.GrabEdgeEventRethrow<TEvConsole::TEvGetAllConfigsResponse>(handle); + UNIT_ASSERT_VALUES_EQUAL(configs->Record.GetResponse().cluster(), ""); + UNIT_ASSERT_VALUES_EQUAL(configs->Record.GetResponse().version(), 1); + UNIT_ASSERT_VALUES_EQUAL(configs->Record.GetResponse().config(), YAML_CONFIG_1_UPDATED); + UNIT_ASSERT_VALUES_EQUAL(configs->Record.GetResponse().volatile_configs_size(), 1); + UNIT_ASSERT_VALUES_EQUAL(configs->Record.GetResponse().volatile_configs(0).config(), VOLATILE_YAML_CONFIG_1_1); + CheckApplyConfig(runtime, Ydb::StatusIds::SUCCESS, YAML_CONFIG_1); CheckAddVolatileConfig(runtime, Ydb::StatusIds::SUCCESS, "", 1, 0, VOLATILE_YAML_CONFIG_1_1); |