Skip to content

Commit 30da80b

Browse files
authored
chore: Bump Rust edition to 2024 (#392)
chore: bump rustls-webpki for security vulnerability and fix Rust 2024 compatibility issues
1 parent 1a8283d commit 30da80b

6 files changed

Lines changed: 40 additions & 40 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ resolver = "2"
66
version = "0.0.0-dev"
77
authors = ["Stackable GmbH <info@stackable.tech>"]
88
license = "OSL-3.0"
9-
edition = "2021"
9+
edition = "2024"
1010
repository = "https://github.com/stackabletech/listener-operator"
1111

1212
[workspace.dependencies]

rust/olm-deployer/src/env/mod.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,33 @@ pub(super) fn maybe_copy_env(
1919
target_gvk: &GroupVersionKind,
2020
) -> anyhow::Result<()> {
2121
let target_kind_set = ["DaemonSet", "Deployment"];
22-
if target_kind_set.contains(&target_gvk.kind.as_str()) {
23-
if let Some(env) = deployer_env_var(source) {
24-
for container in containers(target)? {
25-
match container {
26-
serde_json::Value::Object(c) => {
27-
let json_env = env
28-
.iter()
29-
.map(|e| serde_json::json!(e))
30-
.collect::<Vec<serde_json::Value>>();
31-
32-
match c.get_mut("env") {
33-
Some(env) => match env {
34-
v @ serde_json::Value::Null => {
35-
*v = serde_json::json!(json_env);
36-
}
37-
serde_json::Value::Array(container_env) => {
38-
container_env.extend_from_slice(&json_env)
39-
}
40-
_ => anyhow::bail!("env is not null or an array"),
41-
},
42-
None => {
43-
c.insert("env".to_string(), serde_json::json!(json_env));
22+
if target_kind_set.contains(&target_gvk.kind.as_str())
23+
&& let Some(env) = deployer_env_var(source)
24+
{
25+
for container in containers(target)? {
26+
match container {
27+
serde_json::Value::Object(c) => {
28+
let json_env = env
29+
.iter()
30+
.map(|e| serde_json::json!(e))
31+
.collect::<Vec<serde_json::Value>>();
32+
33+
match c.get_mut("env") {
34+
Some(env) => match env {
35+
v @ serde_json::Value::Null => {
36+
*v = serde_json::json!(json_env);
4437
}
38+
serde_json::Value::Array(container_env) => {
39+
container_env.extend_from_slice(&json_env)
40+
}
41+
_ => anyhow::bail!("env is not null or an array"),
42+
},
43+
None => {
44+
c.insert("env".to_string(), serde_json::json!(json_env));
4545
}
4646
}
47-
_ => anyhow::bail!("no containers found in object {}", target.name_any()),
4847
}
48+
_ => anyhow::bail!("no containers found in object {}", target.name_any()),
4949
}
5050
}
5151
}

rust/olm-deployer/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ async fn main() -> Result<()> {
154154
env::maybe_copy_env(&deployment, &mut obj, &gvk)?;
155155
resources::maybe_copy_resources(&deployment, &mut obj, &gvk)?;
156156
// ---------- apply
157-
apply(&api, obj, &gvk.kind).await?
157+
apply(&api, obj, &gvk.kind).await?;
158158
}
159159
}
160160
}

rust/olm-deployer/src/resources/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ pub(super) fn maybe_copy_resources(
1919
target_gvk: &GroupVersionKind,
2020
) -> anyhow::Result<()> {
2121
let target_kind_set = ["DaemonSet", "Deployment"];
22-
if target_kind_set.contains(&target_gvk.kind.as_str()) {
23-
if let Some(res) = deployment_resources(source) {
24-
for container in containers(target)? {
25-
match container {
26-
serde_json::Value::Object(c) => {
27-
c.insert("resources".to_string(), serde_json::json!(res));
28-
}
29-
_ => anyhow::bail!("no containers found in object {}", target.name_any()),
22+
if target_kind_set.contains(&target_gvk.kind.as_str())
23+
&& let Some(res) = deployment_resources(source)
24+
{
25+
for container in containers(target)? {
26+
match container {
27+
serde_json::Value::Object(c) => {
28+
c.insert("resources".to_string(), serde_json::json!(res));
3029
}
30+
_ => anyhow::bail!("no containers found in object {}", target.name_any()),
3131
}
3232
}
3333
}

0 commit comments

Comments
 (0)