From 29218968dbc6a4c49a852478b38ad627d0ef090c Mon Sep 17 00:00:00 2001 From: Vibhav Bobade Date: Wed, 27 Nov 2024 15:32:25 +0530 Subject: [PATCH 1/2] feat: use default config path when no arg for -f is provided --- mirrord/cli/src/config.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mirrord/cli/src/config.rs b/mirrord/cli/src/config.rs index 57572ace947..93190ca2e49 100644 --- a/mirrord/cli/src/config.rs +++ b/mirrord/cli/src/config.rs @@ -200,7 +200,7 @@ pub(super) struct ExecParams { pub disable_version_check: bool, /// Load config from config file - #[arg(short = 'f', long, value_hint = ValueHint::FilePath)] + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_value = "./mirrord.json" )] pub config_file: Option, /// Kube context to use from Kubeconfig @@ -421,7 +421,7 @@ pub(super) struct PortForwardArgs { pub disable_version_check: bool, /// Load config from config file - #[arg(short = 'f', long, value_hint = ValueHint::FilePath)] + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_value = "./mirrord.json")] pub config_file: Option, /// Kube context to use from Kubeconfig @@ -582,7 +582,7 @@ pub(super) enum OperatorCommand { /// Print operator status Status { /// Specify config file to use - #[arg(short = 'f', long, value_hint = ValueHint::FilePath)] + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_value = "./mirrord.json")] config_file: Option, }, /// Operator session management commands. @@ -708,14 +708,14 @@ pub(super) struct ListTargetArgs { pub namespace: Option, /// Specify config file to use - #[arg(short = 'f', long, value_hint = ValueHint::FilePath)] + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_value = "./mirrord.json")] pub config_file: Option, } #[derive(Args, Debug)] pub(super) struct ExtensionExecArgs { /// Specify config file to use - #[arg(short = 'f', long, value_hint = ValueHint::FilePath)] + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_value = "./mirrord.json")] pub config_file: Option, /// Specify target #[arg(short = 't')] @@ -754,7 +754,7 @@ pub(super) enum DiagnoseCommand { /// Check network connectivity and provide RTT (latency) statistics. Latency { /// Specify config file to use - #[arg(short = 'f', long, value_hint = ValueHint::FilePath)] + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_value = "./mirrord.json")] config_file: Option, }, } @@ -849,7 +849,7 @@ pub(super) struct VpnArgs { pub namespace: Option, /// Load config from config file - #[arg(short = 'f', long, value_hint = ValueHint::FilePath)] + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_value = "./mirrord.json")] pub config_file: Option, #[cfg(target_os = "macos")] From 2fb93d8ef0848cce158ddf4c8fbb48740c514322 Mon Sep 17 00:00:00 2001 From: Vibhav Bobade Date: Wed, 27 Nov 2024 15:37:13 +0530 Subject: [PATCH 2/2] add changelog wrt issue 1706 --- changelog.d/1706.changed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/1706.changed.md diff --git a/changelog.d/1706.changed.md b/changelog.d/1706.changed.md new file mode 100644 index 00000000000..4bfd36a59fe --- /dev/null +++ b/changelog.d/1706.changed.md @@ -0,0 +1 @@ +add default value './mirrord.json' for the `--config-file` flag. \ No newline at end of file