diff options
author | mzinal <zinal@ydb.tech> | 2023-01-13 15:05:44 +0300 |
---|---|---|
committer | mzinal <zinal@ydb.tech> | 2023-01-13 15:05:44 +0300 |
commit | a4fe524f1ed62f0599525059e8d70b1fa5758960 (patch) | |
tree | 881582c35decbb0fd68f743921b65896e55b3783 | |
parent | 8d5dbf9ba65e29dd6c98c1a7c686e27a1993a1fc (diff) | |
download | ydb-a4fe524f1ed62f0599525059e8d70b1fa5758960.tar.gz |
configure ItemConfigGeneration for DefineHostConfig command in 'admin blobstorage init'
-rw-r--r-- | ydb/library/yaml_config/yaml_config_parser.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ydb/library/yaml_config/yaml_config_parser.cpp b/ydb/library/yaml_config/yaml_config_parser.cpp index fa6f573910..179ecf2a9d 100644 --- a/ydb/library/yaml_config/yaml_config_parser.cpp +++ b/ydb/library/yaml_config/yaml_config_parser.cpp @@ -801,18 +801,18 @@ namespace NKikimr::NYaml { NKikimrBlobStorage::TConfigRequest result; + const auto itemConfigGeneration = json.Has("storage_config_generation") ? + GetUnsignedIntegerSafe(json, "storage_config_generation") : 0; + for(auto hostConfig: json["host_configs"].GetArraySafe()) { auto *hostConfigProto = result.AddCommand()->MutableDefineHostConfig(); NProtobufJson::MergeJson2Proto(hostConfig, *hostConfigProto, GetJsonToProtoConfig()); + hostConfigProto->SetItemConfigGeneration(itemConfigGeneration); } auto *defineBox = result.AddCommand()->MutableDefineBox(); defineBox->SetBoxId(1); - if (json.Has("storage_config_generation")) { - defineBox->SetItemConfigGeneration(GetUnsignedIntegerSafe(json, "storage_config_generation")); - } else { - defineBox->SetItemConfigGeneration(0); - } + defineBox->SetItemConfigGeneration(itemConfigGeneration); for(auto jsonHost: json["hosts"].GetArraySafe()) { auto* host = defineBox->AddHost(); |