Skip to content

Commit 16be9b2

Browse files
committed
chore: bump Rust edition to 2024 and apply cargo fix + clippy updates
Run `cargo fix --edition` and resolve resulting warnings: - Add `use<>` syntax to `impl Trait` return types (auto-fixed) - Fix Rust 2024 temporary drop order change by simplifying `_initial_reconcile_rx` handling - Apply rustFMT suggestions
1 parent 9307c28 commit 16be9b2

6 files changed

Lines changed: 29 additions & 30 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/nifi-operator"
1111

1212
[workspace.dependencies]

rust/operator-binary/src/config/jvm.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,16 @@ pub fn build_merged_jvm_config(
9393
// respects these JVM-wide SSL system properties. So there is no plugin-level configuration
9494
// available for truststore settings. This was last checked for version 1.7.0 of the Styra
9595
// OPA Java SDK.
96-
if let Some(authz_config) = authorization_config {
97-
if authz_config.has_opa_tls() {
98-
jvm_args.push(format!(
99-
"-Djavax.net.ssl.trustStore={STACKABLE_SERVER_TLS_DIR}/truststore.p12"
100-
));
101-
jvm_args.push(format!(
102-
"-Djavax.net.ssl.trustStorePassword={STACKABLE_TLS_STORE_PASSWORD}"
103-
));
104-
jvm_args.push("-Djavax.net.ssl.trustStoreType=pkcs12".to_owned());
105-
}
96+
if let Some(authz_config) = authorization_config
97+
&& authz_config.has_opa_tls()
98+
{
99+
jvm_args.push(format!(
100+
"-Djavax.net.ssl.trustStore={STACKABLE_SERVER_TLS_DIR}/truststore.p12"
101+
));
102+
jvm_args.push(format!(
103+
"-Djavax.net.ssl.trustStorePassword={STACKABLE_TLS_STORE_PASSWORD}"
104+
));
105+
jvm_args.push("-Djavax.net.ssl.trustStoreType=pkcs12".to_owned());
106106
}
107107

108108
let operator_generated = JvmArgumentOverrides::new_with_only_additions(jvm_args);

rust/operator-binary/src/controller.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -625,26 +625,25 @@ pub async fn reconcile_nifi(
625625
}
626626

627627
// Only add the reporting task in case it is enabled.
628-
if nifi.spec.cluster_config.create_reporting_task_job.enabled {
629-
if let Some((reporting_task_job, reporting_task_service)) = build_maybe_reporting_task(
628+
if nifi.spec.cluster_config.create_reporting_task_job.enabled
629+
&& let Some((reporting_task_job, reporting_task_service)) = build_maybe_reporting_task(
630630
nifi,
631631
&resolved_product_image,
632632
&client.kubernetes_cluster_info,
633633
&authentication_config,
634634
&rbac_sa.name_any(),
635635
)
636636
.context(ReportingTaskSnafu)?
637-
{
638-
cluster_resources
639-
.add(client, reporting_task_service)
640-
.await
641-
.context(ApplyCreateReportingTaskServiceSnafu)?;
637+
{
638+
cluster_resources
639+
.add(client, reporting_task_service)
640+
.await
641+
.context(ApplyCreateReportingTaskServiceSnafu)?;
642642

643-
cluster_resources
644-
.add(client, reporting_task_job)
645-
.await
646-
.context(ApplyCreateReportingTaskJobSnafu)?;
647-
}
643+
cluster_resources
644+
.add(client, reporting_task_job)
645+
.await
646+
.context(ApplyCreateReportingTaskJobSnafu)?;
648647
}
649648

650649
// Remove any orphaned resources that still exist in k8s, but have not been added to

rust/operator-binary/src/reporting_task/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ fn get_reporting_task_service_selector_pod(nifi: &v1alpha1::NifiCluster) -> Resu
191191
selector_role_group = Some(role_group_name);
192192
}
193193

194-
if let Some(replicas) = role_group.replicas {
195-
if replicas > 0 {
196-
selector_role_group = Some(role_group_name);
197-
break;
198-
}
194+
if let Some(replicas) = role_group.replicas
195+
&& replicas > 0
196+
{
197+
selector_role_group = Some(role_group_name);
198+
break;
199199
}
200200
}
201201

rust/operator-binary/src/webhooks/conversion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub async fn create_webhook_server(
4040
field_manager: FIELD_MANAGER.to_owned(),
4141
};
4242

43-
let (conversion_webhook, _initial_reconcile_rx) =
43+
let (conversion_webhook, _) =
4444
ConversionWebhook::new(crds_and_handlers, client, conversion_webhook_options);
4545

4646
let webhook_server_options = WebhookServerOptions {

0 commit comments

Comments
 (0)