Skip to content

Commit 7d3005f

Browse files
chore: Upgrade to Rust edition 2024
1 parent 4ec9e81 commit 7d3005f

3 files changed

Lines changed: 12 additions & 15 deletions

File tree

Cargo.nix

Lines changed: 1 addition & 1 deletion
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/commons-operator"
1111

1212
[workspace.dependencies]

rust/operator-binary/src/restart_controller/pod.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -220,23 +220,20 @@ async fn report_result(
220220
const EVICT_ERROR_MESSAGE: &str =
221221
"Cannot evict pod as it would violate the pod's disruption budget.";
222222

223-
// TODO: We need Rust 1.88 and 2024 edition for if-let-chains
224-
if let kube::Error::Api(s) = evict_pod_error {
225-
if let Status {
223+
if let kube::Error::Api(s) = evict_pod_error
224+
&& let Status {
226225
code: TOO_MANY_REQUESTS_HTTP_CODE,
227226
message: error_message,
228227
..
229228
} = s.deref()
230-
{
231-
if error_message == EVICT_ERROR_MESSAGE {
232-
tracing::info!(
233-
k8s.object.ref = %pod_ref,
234-
error = %evict_pod_error,
235-
"Tried to evict Pod, but wasn't allowed to do so, as it would violate the Pod's disruption budget. Retrying later"
236-
);
237-
return;
238-
}
239-
}
229+
&& error_message == EVICT_ERROR_MESSAGE
230+
{
231+
tracing::info!(
232+
k8s.object.ref = %pod_ref,
233+
error = %evict_pod_error,
234+
"Tried to evict Pod, but wasn't allowed to do so, as it would violate the Pod's disruption budget. Retrying later"
235+
);
236+
return;
240237
}
241238
}
242239

0 commit comments

Comments
 (0)