Skip to content

Commit 1f37dc5

Browse files
author
Jenkins CI
committed
Merge branch 'bug_23834/make_check_connection_an_option_of_the_update_command_pr'
2 parents 9f813e4 + 718a355 commit 1f37dc5

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

relay/sources/rudder-package/src/cli.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ pub struct Args {
4545
#[derive(Debug, Subcommand)]
4646
pub enum Command {
4747
/// Update package index and licenses from the repository
48-
Update {},
48+
Update {
49+
#[clap(long, short, help = "Only check for server connectivity")]
50+
check: bool,
51+
},
4952
/// Install plugins, locally or from the repository
5053
Install {
5154
#[clap(long, short, help = "Force installation of given plugin")]
@@ -119,6 +122,4 @@ pub enum Command {
119122
)]
120123
incompatible: bool,
121124
},
122-
/// Test connection to the plugin repository
123-
CheckConnection {},
124125
}

relay/sources/rudder-package/src/lib.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,13 @@ pub fn run() -> Result<()> {
202202
)
203203
}
204204
}
205-
Command::Update {} => {
206-
repo.update(&webapp)?;
207-
info!("Index and licenses successfully updated")
205+
Command::Update { check } => {
206+
if check {
207+
repo.test_connection()?;
208+
} else {
209+
repo.update(&webapp)?;
210+
info!("Index and licenses successfully updated")
211+
}
208212
}
209213
Command::Enable {
210214
package,
@@ -292,7 +296,6 @@ pub fn run() -> Result<()> {
292296
info!("Plugins successfully disabled");
293297
}
294298
}
295-
Command::CheckConnection {} => repo.test_connection()?,
296299
}
297300
// Restart if needed
298301
webapp.apply_changes()?;

0 commit comments

Comments
 (0)