Skip to content

Commit 44b81f4

Browse files
authored
Merge pull request #352 from bottlerocket-os/develop
Merge develop to 5.4.x branch for 5.4.1 release
2 parents 78cb2f3 + edec0b2 commit 44b81f4

File tree

5 files changed

+36
-8
lines changed

5 files changed

+36
-8
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# v5.4.1 (2025-01-16)
2+
3+
## OS Change
4+
* Parse proxy URI after prepending URL scheme ([#339])
5+
* Normalize inputs for ephemeral-storage ([#350])
6+
7+
[#339]: https://github.com/bottlerocket-os/bottlerocket-core-kit/pull/339
8+
[#350]: https://github.com/bottlerocket-os/bottlerocket-core-kit/pull/350
9+
110
# v5.4.0 (2025-01-14)
211

312
## OS Change

Twoliter.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
schema-version = 1
2-
release-version = "5.4.0"
2+
release-version = "5.4.1"
33

44
[vendor.bottlerocket]
55
registry = "public.ecr.aws/bottlerocket"

sources/api/apiserver/src/server/ephemeral_storage.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ pub fn bind(variant: &str, dirs: Vec<String>) -> Result<()> {
118118
_ => format!("{}{}", RAID_DEVICE_DIR, RAID_DEVICE_NAME),
119119
};
120120

121+
// Normalize input by trimming trailing "/"
122+
let dirs: Vec<String> = dirs
123+
.into_iter()
124+
.map(|dir| dir.trim_end_matches("/").to_string())
125+
.collect();
126+
121127
let mount_point = format!("/mnt/{}", EPHEMERAL_MNT);
122128
let mount_point = Path::new(&mount_point);
123129
let allowed_dirs = allowed_bind_dirs(variant);

sources/aws-smithy-experimental/src/hyper_1_0.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ mod build_connector {
256256
}
257257
let mut proxy = Proxy::new(intercept, proxy_uri);
258258
// Parse https_proxy as URL to extract out auth information if any
259-
let proxy_url = Url::parse(https_proxy).expect("Unable to parse HTTPS proxy as URL");
259+
let proxy_url =
260+
Url::parse(&proxy.uri().to_string()).expect("Unable to parse HTTPS proxy as URL");
260261

261262
if !proxy_url.username().is_empty() || proxy_url.password().is_some() {
262263
proxy.set_authorization(Authorization::basic(

sources/bootstrap-commands/src/main.rs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ prior to `preconfigured.target` while `[email protected]` which is a requ
3636
running "exec" commands are launched after preconfigured.target.
3737
*/
3838

39-
use log::info;
39+
use log::{info, warn};
4040
use serde::Deserialize;
4141
use simplelog::{Config as LogConfig, LevelFilter, SimpleLogger};
4242
use snafu::{ensure, OptionExt, ResultExt};
@@ -100,11 +100,16 @@ where
100100
{
101101
let mut command = Command::new(bin_path);
102102

103-
command
103+
let output = command
104104
.args(args)
105-
.status()
105+
.output()
106106
.context(error::ExecutionFailureSnafu { command })?;
107107

108+
ensure!(
109+
output.status.success(),
110+
error::CommandFailureSnafu { bin_path, output }
111+
);
112+
108113
Ok(())
109114
}
110115

@@ -198,10 +203,13 @@ fn run() -> Result<()> {
198203
for (bootstrap_command_name, bootstrap_command) in bootstrap_commands.iter() {
199204
let name = bootstrap_command_name.as_ref();
200205
let essential = bootstrap_command.essential;
201-
let status = handle_bootstrap_command(name, bootstrap_command);
206+
let result = handle_bootstrap_command(name, bootstrap_command);
202207

208+
if let Err(ref e) = result {
209+
warn!("Bootstrap command failed to execute {}", e);
210+
}
203211
ensure!(
204-
!essential || status.is_ok(),
212+
!essential || result.is_ok(),
205213
error::BootstrapCommandExecutionSnafu { name }
206214
)
207215
}
@@ -221,7 +229,7 @@ fn main() {
221229
mod error {
222230
use snafu::Snafu;
223231
use std::path::PathBuf;
224-
use std::process::Command;
232+
use std::process::{Command, Output};
225233

226234
#[derive(Debug, Snafu)]
227235
#[snafu(visibility(pub(super)))]
@@ -247,6 +255,10 @@ mod error {
247255
source: std::io::Error,
248256
},
249257

258+
#[snafu(display("'{}' failed - stderr: {}",
259+
bin_path, String::from_utf8_lossy(&output.stderr)))]
260+
CommandFailure { bin_path: String, output: Output },
261+
250262
#[snafu(display("Logger setup error: {}", source))]
251263
Logger { source: log::SetLoggerError },
252264

0 commit comments

Comments
 (0)