Skip to content
Snippets Groups Projects
Commit 2ea3b697 authored by Yaroslav Dynnikov's avatar Yaroslav Dynnikov
Browse files

refactor: make cluster_id parameter optional

Just supply it with a default value "demo". No new tests are necessary,
we already have `test/int/test_joining.py::test_cluster_id_mismatch`.

Close https://git.picodata.io/picodata/picodata/picodata/-/issues/96
parent 44804d01
No related branches found
No related tags found
1 merge request!136Make cluster_id parameter optional
Pipeline #6857 passed
......@@ -22,8 +22,14 @@ pub enum Picodata {
#[derive(Debug, Parser, tlua::Push, PartialEq)]
#[clap(about = "Run the picodata instance")]
pub struct Run {
#[clap(long, value_name = "name", env = "PICODATA_CLUSTER_ID")]
/// Name of the cluster
#[clap(
long,
value_name = "name",
default_value = "demo",
env = "PICODATA_CLUSTER_ID"
)]
/// Name of the cluster. The instance will refuse
/// to join a cluster with a different name.
pub cluster_id: String,
#[clap(
......@@ -268,7 +274,6 @@ mod tests {
fn test_parse() {
let _env_dump = EnvDump::new();
std::env::set_var("PICODATA_CLUSTER_ID", "cluster1");
std::env::set_var("PICODATA_INSTANCE_ID", "instance-id-from-env");
std::env::set_var("PICODATA_PEER", "peer-from-env");
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment