Skip to content

Commit 0a8b6d4

Browse files
authored
Merge pull request #587 from koooosh/bump-sdk-0.63.0
twoliter: update sdk version to 0.63.0
2 parents d602351 + 7e6051e commit 0a8b6d4

File tree

86 files changed

+364
-406
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+364
-406
lines changed

Twoliter.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kit = []
33

44
[sdk]
55
name = "bottlerocket-sdk"
6-
version = "0.62.0"
6+
version = "0.63.0"
77
vendor = "bottlerocket"
8-
source = "public.ecr.aws/bottlerocket/bottlerocket-sdk:v0.62.0"
9-
digest = "xlGP2vIM7M1kj36BuRc/lgK8mz8ZpHw6XROwMQ9hUOM="
8+
source = "public.ecr.aws/bottlerocket/bottlerocket-sdk:v0.63.0"
9+
digest = "qoCURTMSE+NeT65OVSYlm+Ex9x2iK5w/B1cMTuG5Rz8="

Twoliter.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ registry = "public.ecr.aws/bottlerocket"
66

77
[sdk]
88
name = "bottlerocket-sdk"
9-
version = "0.62.0"
9+
version = "0.63.0"
1010
vendor = "bottlerocket"

sources/api/apiclient/src/apply.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ where
4545
// Send the settings changes to the server in the same transaction. (They're quick local
4646
// requests, so don't add the complexity of making them run concurrently.)
4747
for (input_source, json) in changes {
48-
let uri = format!("/settings?tx={}", transaction);
48+
let uri = format!("/settings?tx={transaction}");
4949
let method = "PATCH";
5050
let (_status, _body) = crate::raw_request(&socket_path, &uri, method, Some(json))
5151
.await
@@ -57,7 +57,7 @@ where
5757
}
5858

5959
// Commit the transaction and apply it to the system.
60-
let uri = format!("/tx/commit_and_apply?tx={}", transaction);
60+
let uri = format!("/tx/commit_and_apply?tx={transaction}");
6161
let method = "POST";
6262
let (_status, _body) = crate::raw_request(&socket_path, &uri, method, None)
6363
.await

sources/api/apiclient/src/ephemeral_storage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ where
5656
{
5757
let mut query = Vec::new();
5858
if let Some(query_format) = format {
59-
query.push(format!("format={}", query_format));
59+
query.push(format!("format={query_format}"));
6060
}
6161

6262
let uri = format!("/actions/ephemeral-storage/{}?{}", item, query.join("&"));

sources/api/apiclient/src/exec/connect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ where
6969

7070
// Create a request object that tokio-tungstenite understands, pointed at a local WebSocket
7171
// URI. This is used to create the WebSocket client.
72-
let ws_uri = format!("ws://localhost{}", path);
72+
let ws_uri = format!("ws://localhost{path}");
7373
let ws_request = httparse::Request {
7474
method: Some("GET"),
7575
path: Some(&ws_uri),

sources/api/apiclient/src/get.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ where
1414

1515
// Fetch all given prefixes into separate Values.
1616
for prefix in prefixes {
17-
let uri = format!("/?prefix={}", prefix);
17+
let uri = format!("/?prefix={prefix}");
1818
let method = "GET";
1919
let (_status, body) = crate::raw_request(&socket_path, &uri, method, None)
2020
.await

sources/api/apiclient/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ pub enum SettingsInput {
167167
impl Display for SettingsInput {
168168
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
169169
match self {
170-
SettingsInput::KeyPair(value) => write!(f, "{}", value),
171-
SettingsInput::Json(value) => write!(f, "{}", value),
170+
SettingsInput::KeyPair(value) => write!(f, "{value}"),
171+
SettingsInput::Json(value) => write!(f, "{value}"),
172172
}
173173
}
174174
}

sources/api/apiclient/src/main.rs

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,8 @@ fn parse_args(args: env::Args) -> (Args, Subcommand) {
314314
let log_level_str = iter
315315
.next()
316316
.unwrap_or_else(|| usage_msg("Did not give argument to --log-level"));
317-
global_args.log_level =
318-
LevelFilter::from_str(&log_level_str).unwrap_or_else(|_| {
319-
usage_msg(format!("Invalid log level '{}'", log_level_str))
320-
});
317+
global_args.log_level = LevelFilter::from_str(&log_level_str)
318+
.unwrap_or_else(|_| usage_msg(format!("Invalid log level '{log_level_str}'")));
321319
}
322320

323321
"-v" | "--verbose" => global_args.log_level = LevelFilter::Debug,
@@ -387,7 +385,7 @@ fn parse_raw_args(args: Vec<String>) -> Subcommand {
387385
)
388386
}
389387

390-
x => usage_msg(format!("Unknown argument '{}'", x)),
388+
x => usage_msg(format!("Unknown argument '{x}'")),
391389
}
392390
}
393391

@@ -438,7 +436,7 @@ fn parse_exec_args(args: Vec<String>) -> Subcommand {
438436
tty = Some(false);
439437
}
440438
x if x.starts_with('-') && command.is_empty() => {
441-
usage_msg(format!("Unknown argument '{}'", x))
439+
usage_msg(format!("Unknown argument '{x}'"))
442440
}
443441

444442
// Target is the first arg we see.
@@ -468,7 +466,7 @@ fn parse_get_args(args: Vec<String>) -> Subcommand {
468466

469467
for arg in args.into_iter() {
470468
match &arg {
471-
x if x.starts_with('-') => usage_msg(format!("Unknown argument '{}'", x)),
469+
x if x.starts_with('-') => usage_msg(format!("Unknown argument '{x}'")),
472470

473471
x if x.starts_with('/') => {
474472
if let Some(_existing_val) = uri.replace(arg) {
@@ -531,10 +529,8 @@ fn parse_set_args(args: Vec<String>) -> Subcommand {
531529
.next()
532530
.unwrap_or_else(|| usage_msg("Did not give argument to -j | --json"));
533531

534-
let input_val: serde_json::Value =
535-
serde_json::from_str(&raw_json).unwrap_or_else(|e| {
536-
usage_msg(format!("Couldn't parse given JSON input: {}", e))
537-
});
532+
let input_val: serde_json::Value = serde_json::from_str(&raw_json)
533+
.unwrap_or_else(|e| usage_msg(format!("Couldn't parse given JSON input: {e}")));
538534

539535
let mut input_map = match input_val {
540536
serde_json::Value::Object(map) => map,
@@ -560,7 +556,7 @@ fn parse_set_args(args: Vec<String>) -> Subcommand {
560556
simple.push(x.to_string());
561557
}
562558

563-
x => usage_msg(format!("Unknown argument '{}'", x)),
559+
x => usage_msg(format!("Unknown argument '{x}'")),
564560
}
565561
}
566562

@@ -620,7 +616,7 @@ fn parse_update_apply_args(args: Vec<String>) -> UpdateSubcommand {
620616
"-c" | "--check" => check = true,
621617
"-r" | "--reboot" => reboot = true,
622618

623-
x => usage_msg(format!("Unknown argument '{}'", x)),
619+
x => usage_msg(format!("Unknown argument '{x}'")),
624620
}
625621
}
626622

@@ -696,7 +692,7 @@ fn parse_cis_arguments(args: Vec<String>) -> CisReportArgs {
696692
)
697693
}
698694

699-
x => usage_msg(format!("Unknown argument '{}'", x)),
695+
x => usage_msg(format!("Unknown argument '{x}'")),
700696
}
701697
}
702698

@@ -721,7 +717,7 @@ fn parse_fips_arguments(args: Vec<String>) -> FipsReportArgs {
721717
)
722718
}
723719

724-
x => usage_msg(format!("Unknown argument '{}'", x)),
720+
x => usage_msg(format!("Unknown argument '{x}'")),
725721
}
726722
}
727723

@@ -790,7 +786,7 @@ fn parse_ephemeral_storage_init_args(args: Vec<String>) -> EphemeralStorageSubco
790786
disks = Some(names);
791787
}
792788
}
793-
x => usage_msg(format!("Unknown argument '{}'", x)),
789+
x => usage_msg(format!("Unknown argument '{x}'")),
794790
}
795791
}
796792
EphemeralStorageSubcommand::Init(EphemeralStorageInitArgs { disks, filesystem })
@@ -811,7 +807,7 @@ fn parse_ephemeral_storage_bind_args(args: Vec<String>) -> EphemeralStorageSubco
811807
usage_msg("Did not give argument to --dirs")
812808
}
813809
}
814-
x => usage_msg(format!("Unknown argument '{}'", x)),
810+
x => usage_msg(format!("Unknown argument '{x}'")),
815811
}
816812
}
817813
EphemeralStorageSubcommand::Bind(EphemeralStorageBindArgs { targets })
@@ -830,7 +826,7 @@ fn parse_ephemeral_storage_list_format_args(args: Vec<String>) -> EphemeralStora
830826
.unwrap_or_else(|| usage_msg("Did not give argument to -f | --format")),
831827
)
832828
}
833-
x => usage_msg(format!("Unknown argument '{}'", x)),
829+
x => usage_msg(format!("Unknown argument '{x}'")),
834830
}
835831
}
836832
EphemeralStorageFormatArgs { format }
@@ -873,10 +869,10 @@ async fn check(args: &Args) -> Result<String> {
873869
.context(error::UpdateCheckSnafu)?;
874870

875871
match serde_json::from_str::<serde_json::Value>(&output) {
876-
Ok(value) => println!("{:#}", value),
872+
Ok(value) => println!("{value:#}"),
877873
Err(e) => {
878874
warn!("Unable to deserialize response (invalid JSON?): {}", e);
879-
println!("{}", output);
875+
println!("{output}");
880876
}
881877
}
882878

@@ -918,10 +914,10 @@ async fn run() -> Result<()> {
918914
// In raw mode, the user is expecting only the server response on stdout, so we more
919915
// carefully control other output and only write it to stderr.
920916
if log_enabled!(log::Level::Debug) {
921-
eprintln!("{}", status);
917+
eprintln!("{status}");
922918
}
923919
if !body.is_empty() {
924-
println!("{}", body);
920+
println!("{body}");
925921
}
926922
}
927923

@@ -945,7 +941,7 @@ async fn run() -> Result<()> {
945941
let value = result.context(error::GetSnafu)?;
946942
let pretty =
947943
serde_json::to_string_pretty(&value).expect("JSON Value already validated as JSON");
948-
println!("{}", pretty);
944+
println!("{pretty}");
949945
}
950946

951947
Subcommand::Reboot(_reboot) => {
@@ -1027,7 +1023,7 @@ async fn run() -> Result<()> {
10271023
.context(error::ReportSnafu)?;
10281024

10291025
if !body.is_empty() {
1030-
print!("{}", body);
1026+
print!("{body}");
10311027
}
10321028
}
10331029

@@ -1042,7 +1038,7 @@ async fn run() -> Result<()> {
10421038
.context(error::ReportSnafu)?;
10431039

10441040
if !body.is_empty() {
1045-
print!("{}", body);
1041+
print!("{body}");
10461042
}
10471043
}
10481044

@@ -1052,7 +1048,7 @@ async fn run() -> Result<()> {
10521048
.context(error::ReportSnafu)?;
10531049

10541050
if !body.is_empty() {
1055-
print!("{}", body);
1051+
print!("{body}");
10561052
}
10571053
}
10581054
},
@@ -1077,15 +1073,15 @@ async fn run() -> Result<()> {
10771073
.await
10781074
.context(error::EphemeralStorageSnafu)?;
10791075
if !body.is_empty() {
1080-
print!("{}", body);
1076+
print!("{body}");
10811077
}
10821078
}
10831079
EphemeralStorageSubcommand::ListDirs(bind_args) => {
10841080
let body = ephemeral_storage::list_dirs(&args.socket_path, bind_args.format)
10851081
.await
10861082
.context(error::EphemeralStorageSnafu)?;
10871083
if !body.is_empty() {
1088-
print!("{}", body);
1084+
print!("{body}");
10891085
}
10901086
}
10911087
},
@@ -1100,7 +1096,7 @@ async fn run() -> Result<()> {
11001096
#[tokio::main]
11011097
async fn main() {
11021098
if let Err(e) = run().await {
1103-
eprintln!("{}", e);
1099+
eprintln!("{e}");
11041100
process::exit(1);
11051101
}
11061102
}

sources/api/apiclient/src/report.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ where
1515

1616
let mut query: Vec<String> = vec![format!("type={}", report_type)];
1717
if let Some(query_format) = format {
18-
query.push(format!("format={}", query_format));
18+
query.push(format!("format={query_format}"));
1919
}
2020
if let Some(query_level) = level {
21-
query.push(format!("level={}", query_level));
21+
query.push(format!("level={query_level}"));
2222
}
2323

2424
let uri = format!("/report/cis?{}", query.join("&"));
@@ -39,7 +39,7 @@ where
3939

4040
let mut query = Vec::new();
4141
if let Some(query_format) = format {
42-
query.push(format!("format={}", query_format));
42+
query.push(format!("format={query_format}"));
4343
}
4444

4545
let uri = format!("/report/fips?{}", query.join("&"));

sources/api/apiclient/src/set.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ where
1515

1616
// Send the settings changes to the server.
1717
let (uri, settings_data) = match settings {
18-
SettingsInput::KeyPair(value) => (format!("/settings/keypair?tx={}", transaction), value),
19-
SettingsInput::Json(value) => (format!("/settings?tx={}", transaction), value),
18+
SettingsInput::KeyPair(value) => (format!("/settings/keypair?tx={transaction}"), value),
19+
SettingsInput::Json(value) => (format!("/settings?tx={transaction}"), value),
2020
};
2121
let method = "PATCH";
2222
let (_status, _body) = crate::raw_request(&socket_path, &uri, method, Some(settings_data))
2323
.await
2424
.context(error::RequestSnafu { uri, method })?;
2525

2626
// Commit the transaction and apply it to the system.
27-
let uri = format!("/tx/commit_and_apply?tx={}", transaction);
27+
let uri = format!("/tx/commit_and_apply?tx={transaction}");
2828
let method = "POST";
2929
let (_status, _body) = crate::raw_request(&socket_path, &uri, method, None)
3030
.await

0 commit comments

Comments
 (0)