diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fb5ab8e3..4af75a4a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# v5.4.1 (2025-01-16) + +## OS Change +* Parse proxy URI after prepending URL scheme ([#339]) +* Normalize inputs for ephemeral-storage ([#350]) + +[#339]: https://github.com/bottlerocket-os/bottlerocket-core-kit/pull/339 +[#350]: https://github.com/bottlerocket-os/bottlerocket-core-kit/pull/350 + # v5.4.0 (2025-01-14) ## OS Change diff --git a/Twoliter.toml b/Twoliter.toml index 4c95ec06a..8fbace07d 100644 --- a/Twoliter.toml +++ b/Twoliter.toml @@ -1,5 +1,5 @@ schema-version = 1 -release-version = "5.4.0" +release-version = "5.4.1" [vendor.bottlerocket] registry = "public.ecr.aws/bottlerocket" diff --git a/sources/api/apiserver/src/server/ephemeral_storage.rs b/sources/api/apiserver/src/server/ephemeral_storage.rs index 6e5cde30d..a206f586b 100644 --- a/sources/api/apiserver/src/server/ephemeral_storage.rs +++ b/sources/api/apiserver/src/server/ephemeral_storage.rs @@ -118,6 +118,12 @@ pub fn bind(variant: &str, dirs: Vec) -> Result<()> { _ => format!("{}{}", RAID_DEVICE_DIR, RAID_DEVICE_NAME), }; + // Normalize input by trimming trailing "/" + let dirs: Vec = dirs + .into_iter() + .map(|dir| dir.trim_end_matches("/").to_string()) + .collect(); + let mount_point = format!("/mnt/{}", EPHEMERAL_MNT); let mount_point = Path::new(&mount_point); let allowed_dirs = allowed_bind_dirs(variant); diff --git a/sources/aws-smithy-experimental/src/hyper_1_0.rs b/sources/aws-smithy-experimental/src/hyper_1_0.rs index 6fde63d3f..8617dc7e4 100644 --- a/sources/aws-smithy-experimental/src/hyper_1_0.rs +++ b/sources/aws-smithy-experimental/src/hyper_1_0.rs @@ -256,7 +256,8 @@ mod build_connector { } let mut proxy = Proxy::new(intercept, proxy_uri); // Parse https_proxy as URL to extract out auth information if any - let proxy_url = Url::parse(https_proxy).expect("Unable to parse HTTPS proxy as URL"); + let proxy_url = + Url::parse(&proxy.uri().to_string()).expect("Unable to parse HTTPS proxy as URL"); if !proxy_url.username().is_empty() || proxy_url.password().is_some() { proxy.set_authorization(Authorization::basic( diff --git a/sources/bootstrap-commands/src/main.rs b/sources/bootstrap-commands/src/main.rs index 293e6b6e6..0b4eef85b 100644 --- a/sources/bootstrap-commands/src/main.rs +++ b/sources/bootstrap-commands/src/main.rs @@ -36,7 +36,7 @@ prior to `preconfigured.target` while `host-containers@.service` which is a requ running "exec" commands are launched after preconfigured.target. */ -use log::info; +use log::{info, warn}; use serde::Deserialize; use simplelog::{Config as LogConfig, LevelFilter, SimpleLogger}; use snafu::{ensure, OptionExt, ResultExt}; @@ -100,11 +100,16 @@ where { let mut command = Command::new(bin_path); - command + let output = command .args(args) - .status() + .output() .context(error::ExecutionFailureSnafu { command })?; + ensure!( + output.status.success(), + error::CommandFailureSnafu { bin_path, output } + ); + Ok(()) } @@ -198,10 +203,13 @@ fn run() -> Result<()> { for (bootstrap_command_name, bootstrap_command) in bootstrap_commands.iter() { let name = bootstrap_command_name.as_ref(); let essential = bootstrap_command.essential; - let status = handle_bootstrap_command(name, bootstrap_command); + let result = handle_bootstrap_command(name, bootstrap_command); + if let Err(ref e) = result { + warn!("Bootstrap command failed to execute {}", e); + } ensure!( - !essential || status.is_ok(), + !essential || result.is_ok(), error::BootstrapCommandExecutionSnafu { name } ) } @@ -221,7 +229,7 @@ fn main() { mod error { use snafu::Snafu; use std::path::PathBuf; - use std::process::Command; + use std::process::{Command, Output}; #[derive(Debug, Snafu)] #[snafu(visibility(pub(super)))] @@ -247,6 +255,10 @@ mod error { source: std::io::Error, }, + #[snafu(display("'{}' failed - stderr: {}", + bin_path, String::from_utf8_lossy(&output.stderr)))] + CommandFailure { bin_path: String, output: Output }, + #[snafu(display("Logger setup error: {}", source))] Logger { source: log::SetLoggerError },