Merge pull request #35020 from ClickHouse/preprocessed_config_in_yaml

Always write preprocessed config in XML format
This commit is contained in:
alexey-milovidov 2022-03-06 02:31:37 +03:00 committed by GitHub
commit 01f8eab2da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -664,6 +664,10 @@ void ConfigProcessor::savePreprocessedConfig(const LoadedConfig & loaded_config,
new_path.erase(0, main_config_path.size()); new_path.erase(0, main_config_path.size());
std::replace(new_path.begin(), new_path.end(), '/', '_'); std::replace(new_path.begin(), new_path.end(), '/', '_');
/// If we have config file in YAML format, the preprocessed config will inherit .yaml extension
/// but will contain config in XML format, so some tools like clickhouse extract-from-config won't work
new_path = fs::path(new_path).replace_extension(".xml").string();
if (preprocessed_dir.empty()) if (preprocessed_dir.empty())
{ {
if (!loaded_config.configuration->has("path")) if (!loaded_config.configuration->has("path"))