Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/trident/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ oci-client = { workspace = true }
procfs = { workspace = true }
rayon = { workspace = true }
regex = { workspace = true }
reqwest = { workspace = true }
reqwest = { workspace = true, features = ["stream"] }
semver = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
Expand Down Expand Up @@ -64,7 +64,7 @@ hyper = { workspace = true }
prost-types = { workspace = true }
tokio = { workspace = true }
tokio-stream = { workspace = true }
tokio-util = { workspace = true }
tokio-util = { workspace = true, features = ["io-util"] }
tonic = { workspace = true }
tonic-middleware = { workspace = true }

Expand Down
4 changes: 2 additions & 2 deletions crates/trident/src/grpc_client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mod tridentclient;
use error::TridentClientError;
use tridentclient::{RebootHandling, TridentClient};

pub fn client_main(args: &ClientArgs) -> ExitCode {
pub fn client_main(args: &ClientArgs, before_reboot: impl FnOnce()) -> ExitCode {
// Start the Tokio runtime
let Ok(runtime) = Builder::new_multi_thread().enable_all().build() else {
error!("Failed to create Tokio runtime");
Expand Down Expand Up @@ -80,7 +80,7 @@ pub fn client_main(args: &ClientArgs) -> ExitCode {
}
Ok(ExitKind::Done) => {}
Ok(ExitKind::NeedsReboot) => {
if let Err(e) = crate::request_reboot_with_wait() {
if let Err(e) = crate::request_reboot_with_wait_and_flush(before_reboot) {
error!("Failed to reboot: {e:?}");
return TridentExitCodes::RebootUnsuccessful.into();
}
Expand Down
4 changes: 3 additions & 1 deletion crates/trident/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pub use crate::{
},
grpc_client::client_main,
logging::{
appinsights::AppInsightsSender,
background_log::BackgroundLog,
background_uploader::{BackgroundUploadHandle, BackgroundUploader},
journald::JournaldTracing,
Expand All @@ -69,10 +70,11 @@ pub use crate::{
run_with_captured_operation, save_reboot_operation, take_reboot_operation,
OperationSource,
},
telemetry_uploader::TelemetryUploader,
tracestream::TraceStream,
},
orchestrate::OrchestratorConnection,
reboot::request_reboot_with_wait,
reboot::{request_reboot_with_wait, request_reboot_with_wait_and_flush},
server::server_main,
};

Expand Down
Loading
Loading