Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop to 5.4.x branch for 5.4.1 release #352

Merged
merged 8 commits into from
Jan 16, 2025
Merged
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Twoliter.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
schema-version = 1
release-version = "5.4.0"
release-version = "5.4.1"

[vendor.bottlerocket]
registry = "public.ecr.aws/bottlerocket"
Expand Down
6 changes: 6 additions & 0 deletions sources/api/apiserver/src/server/ephemeral_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ pub fn bind(variant: &str, dirs: Vec<String>) -> Result<()> {
_ => format!("{}{}", RAID_DEVICE_DIR, RAID_DEVICE_NAME),
};

// Normalize input by trimming trailing "/"
let dirs: Vec<String> = 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);
Expand Down
3 changes: 2 additions & 1 deletion sources/aws-smithy-experimental/src/hyper_1_0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
24 changes: 18 additions & 6 deletions sources/bootstrap-commands/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ prior to `preconfigured.target` while `[email protected]` 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};
Expand Down Expand Up @@ -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(())
}

Expand Down Expand Up @@ -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 }
)
}
Expand All @@ -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)))]
Expand All @@ -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 },

Expand Down
Loading