Skip to content

Commit

Permalink
feat: plugin executor configurable
Browse files Browse the repository at this point in the history
Signed-off-by: Aisha M <[email protected]>
  • Loading branch information
aamohd committed Jan 6, 2025
1 parent 1f7811a commit d732b89
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions hipcheck/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ impl ExecConfig {
/* jitter_percent */ plugin_data.jitter.percent,
/*grpc_buffer*/ plugin_data.grpc_buffer.size,
)
}
}

impl FromStr for ExecConfig {
Expand Down
22 changes: 7 additions & 15 deletions hipcheck/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,18 +514,6 @@ fn cmd_plugin(args: PluginArgs, config: &CliConfig) -> ExitCode {
.context("Failed to locate the exec config. Please make sure the exec config file exists somewhere in this directory or one of its parents as '.hipcheck/Exec.kdl'.")
};

let exec_config = match res_exec_config {
Ok(config) => {
config
},
Err(e) => {
Shell::print_error(&hc_error!("Failed to resolve the exec config {}", e), Format::Human);
return ExitCode::FAILURE;
}

config
}.unwrap();

let exec_config = match res_exec_config {
Ok(config) => {
config
Expand All @@ -536,9 +524,13 @@ fn cmd_plugin(args: PluginArgs, config: &CliConfig) -> ExitCode {
}
};

let plugin_executor = ExecConfig::get_plugin_executor(&exec_config)
.context("Failed to resolve the Plugin Executor.")
.unwrap();
let plugin_executor = match ExecConfig::get_plugin_executor(&exec_config) {
Ok(e) => e,
Err(e) => {
Shell::print_error(&hc_error!("Failed to resolve the Plugin Executor {}", e), Format::Human);
return ExitCode::FAILURE;
}
};

let engine = match HcEngineImpl::new(
plugin_executor,
Expand Down

0 comments on commit d732b89

Please sign in to comment.