From 175691a5e81dac17e685f5cf3de31ec0f86119e5 Mon Sep 17 00:00:00 2001 From: Kurdakov Alexander <kusancho12@gmail.com> Date: Wed, 4 Dec 2024 19:22:00 +0300 Subject: [PATCH] rename: default config name --- CHANGELOG.md | 2 ++ src/cli/args.rs | 4 ++-- src/config.rs | 4 ++-- test/conftest.py | 2 +- test/int/test_config_file.py | 8 ++++---- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba94bce40f..6e40466ac3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ with the `YY.MINOR.MICRO` scheme. - New alter system parameters - `vdbe_max_steps` and `vtable_max_rows`. +- Default config name is `picodata.yaml`. + ### CLI - `picodata expel` takes instance uuid instead of instance name. diff --git a/src/cli/args.rs b/src/cli/args.rs index 176e7a9c1e..19d6cdd74f 100644 --- a/src/cli/args.rs +++ b/src/cli/args.rs @@ -49,7 +49,7 @@ pub struct Run { #[clap(long, value_name = "PATH", env = "PICODATA_CONFIG_FILE")] /// Path to configuration file in yaml format. /// - /// By default "./config.yaml" is used if it exists. + /// By default "./picodata.yaml" is used if it exists. pub config: Option<PathBuf>, #[clap( @@ -60,7 +60,7 @@ pub struct Run { )] /// A list of key-value pairs specifying configuration parameters. /// - /// These will override both parameters provided in the config.yaml file, + /// These will override both parameters provided in the picodata.yaml file, /// the command-line parameters and the environment variables. /// /// Key is a `.` separated path to a configuration parameter. diff --git a/src/config.rs b/src/config.rs index 6e40470af8..0a494873cc 100644 --- a/src/config.rs +++ b/src/config.rs @@ -36,7 +36,7 @@ use tarantool::tuple::Tuple; pub use sbroad::ir::relation::Type as SbroadType; pub use crate::address::{DEFAULT_IPROTO_PORT, DEFAULT_LISTEN_HOST, DEFAULT_USERNAME}; -pub const DEFAULT_CONFIG_FILE_NAME: &str = "config.yaml"; +pub const DEFAULT_CONFIG_FILE_NAME: &str = "picodata.yaml"; //////////////////////////////////////////////////////////////////////////////// // PicodataConfig @@ -432,7 +432,7 @@ Using configuration file '{args_path}'."); // TODO: for future compatibility this is a very bad approach. Image if // you will this scenario, picodata 69.3 has added a new parameter // "maximum_security" and now we want to add it to the config file. - // But we have a config.yaml file for picodata 42.8 which is already deployed, + // But we have a picodata.yaml file for picodata 42.8 which is already deployed, // we add the new parameter to that config and then we try to start the // old picodata with the new config, and what we get? Error. Now you // have to go and copy-paste all of your config files and have at least diff --git a/test/conftest.py b/test/conftest.py index 23dc184a31..5af868c089 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -1645,7 +1645,7 @@ class Cluster: assert config or yaml assert self.config_path is None - self.config_path = self.data_dir + "/config.yaml" + self.config_path = self.data_dir + "/picodata.yaml" if config: yaml = yaml_lib.dump(config, default_flow_style=False) diff --git a/test/int/test_config_file.py b/test/int/test_config_file.py index c6dabb0fe9..e8471de112 100644 --- a/test/int/test_config_file.py +++ b/test/int/test_config_file.py @@ -135,10 +135,10 @@ instance: def test_default_path_to_config_file(cluster: Cluster): instance = cluster.add_instance(name=False, wait_online=False) - # By default ./config.yaml will be used in the instance's current working directory + # By default ./picodata.yaml will be used in the instance's current working directory work_dir = cluster.data_dir + "/work-dir" os.mkdir(work_dir) - with open(work_dir + "/config.yaml", "w") as f: + with open(work_dir + "/picodata.yaml", "w") as f: f.write( """ cluster: @@ -157,7 +157,7 @@ instance: instance.terminate() # But if a config is specified explicitly, it will be used instead - config_path = cluster.data_dir + "/explicit-config.yaml" + config_path = cluster.data_dir + "/explicit-picodata.yaml" with open(config_path, "w") as f: f.write( """ @@ -174,7 +174,7 @@ instance: msg = f"""\ A path to configuration file '{config_path}' was provided explicitly, -but a 'config.yaml' file in the current working directory '{work_dir}' also exists. +but a 'picodata.yaml' file in the current working directory '{work_dir}' also exists. Using configuration file '{config_path}'. """ # noqa E501 crawler = log_crawler(instance, msg) -- GitLab