diff --git a/Cargo.lock b/Cargo.lock index 25ac572e..ba04abdf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -97,9 +97,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.102" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" [[package]] name = "arc-swap" @@ -280,9 +280,9 @@ dependencies = [ [[package]] name = "built" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ad8f11f288f48ca24471bbd51ac257aaeaaa07adae295591266b792902ae64" +checksum = "5c0e531d93d39c34eef561e929e8a7f86d77a5af08aac4f6d6e39976c51858e9" dependencies = [ "chrono", "git2", @@ -1023,15 +1023,14 @@ dependencies = [ [[package]] name = "git2" -version = "0.20.4" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b88256088d75a56f8ecfa070513a775dd9107f6530ef14919dac831af9cfe2b" +checksum = "ddddbf932745a6be37109b6112d3ee09696106f848449069d3a57bba937ab82e" dependencies = [ "bitflags", "libc", "libgit2-sys", "log", - "url", ] [[package]] @@ -1735,9 +1734,9 @@ checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" [[package]] name = "libgit2-sys" -version = "0.18.3+1.9.2" +version = "0.18.5+1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9b3acc4b91781bb0b3386669d325163746af5f6e4f73e6d2d630e09a35f3487" +checksum = "005d6ae6eac1912906073e069f7db60b1fa98e052a68227824afe3e3a1c59ca2" dependencies = [ "cc", "libc", diff --git a/Cargo.nix b/Cargo.nix index cf857536..3baa6901 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -9991,7 +9991,7 @@ rec { "stackable-nifi-operator" = rec { crateName = "stackable-nifi-operator"; version = "0.0.0-dev"; - edition = "2021"; + edition = "2024"; crateBin = [ { name = "stackable-nifi-operator"; diff --git a/Cargo.toml b/Cargo.toml index 7ad6543a..553c9811 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ resolver = "2" version = "0.0.0-dev" authors = ["Stackable GmbH "] license = "OSL-3.0" -edition = "2021" +edition = "2024" repository = "https://github.com/stackabletech/nifi-operator" [workspace.dependencies] @@ -14,7 +14,7 @@ product-config = { git = "https://github.com/stackabletech/product-config.git", stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.111.0", features = ["webhook"] } anyhow = "1.0" -built = { version = "0.8", features = ["chrono", "git2"] } +built = { version = "0.8.1", features = ["chrono", "git2"] } clap = "4.5" const_format = "0.2" fnv = "1.0" diff --git a/rust/operator-binary/src/config/jvm.rs b/rust/operator-binary/src/config/jvm.rs index 22bb4f9d..af0aedc1 100644 --- a/rust/operator-binary/src/config/jvm.rs +++ b/rust/operator-binary/src/config/jvm.rs @@ -93,16 +93,16 @@ pub fn build_merged_jvm_config( // respects these JVM-wide SSL system properties. So there is no plugin-level configuration // available for truststore settings. This was last checked for version 1.7.0 of the Styra // OPA Java SDK. - if let Some(authz_config) = authorization_config { - if authz_config.has_opa_tls() { - jvm_args.push(format!( - "-Djavax.net.ssl.trustStore={STACKABLE_SERVER_TLS_DIR}/truststore.p12" - )); - jvm_args.push(format!( - "-Djavax.net.ssl.trustStorePassword={STACKABLE_TLS_STORE_PASSWORD}" - )); - jvm_args.push("-Djavax.net.ssl.trustStoreType=pkcs12".to_owned()); - } + if let Some(authz_config) = authorization_config + && authz_config.has_opa_tls() + { + jvm_args.push(format!( + "-Djavax.net.ssl.trustStore={STACKABLE_SERVER_TLS_DIR}/truststore.p12" + )); + jvm_args.push(format!( + "-Djavax.net.ssl.trustStorePassword={STACKABLE_TLS_STORE_PASSWORD}" + )); + jvm_args.push("-Djavax.net.ssl.trustStoreType=pkcs12".to_owned()); } let operator_generated = JvmArgumentOverrides::new_with_only_additions(jvm_args); diff --git a/rust/operator-binary/src/controller.rs b/rust/operator-binary/src/controller.rs index a2b0cd52..c5194be6 100644 --- a/rust/operator-binary/src/controller.rs +++ b/rust/operator-binary/src/controller.rs @@ -625,8 +625,8 @@ pub async fn reconcile_nifi( } // Only add the reporting task in case it is enabled. - if nifi.spec.cluster_config.create_reporting_task_job.enabled { - if let Some((reporting_task_job, reporting_task_service)) = build_maybe_reporting_task( + if nifi.spec.cluster_config.create_reporting_task_job.enabled + && let Some((reporting_task_job, reporting_task_service)) = build_maybe_reporting_task( nifi, &resolved_product_image, &client.kubernetes_cluster_info, @@ -634,17 +634,16 @@ pub async fn reconcile_nifi( &rbac_sa.name_any(), ) .context(ReportingTaskSnafu)? - { - cluster_resources - .add(client, reporting_task_service) - .await - .context(ApplyCreateReportingTaskServiceSnafu)?; + { + cluster_resources + .add(client, reporting_task_service) + .await + .context(ApplyCreateReportingTaskServiceSnafu)?; - cluster_resources - .add(client, reporting_task_job) - .await - .context(ApplyCreateReportingTaskJobSnafu)?; - } + cluster_resources + .add(client, reporting_task_job) + .await + .context(ApplyCreateReportingTaskJobSnafu)?; } // Remove any orphaned resources that still exist in k8s, but have not been added to diff --git a/rust/operator-binary/src/reporting_task/mod.rs b/rust/operator-binary/src/reporting_task/mod.rs index cdee4c54..730f3b62 100644 --- a/rust/operator-binary/src/reporting_task/mod.rs +++ b/rust/operator-binary/src/reporting_task/mod.rs @@ -191,11 +191,11 @@ fn get_reporting_task_service_selector_pod(nifi: &v1alpha1::NifiCluster) -> Resu selector_role_group = Some(role_group_name); } - if let Some(replicas) = role_group.replicas { - if replicas > 0 { - selector_role_group = Some(role_group_name); - break; - } + if let Some(replicas) = role_group.replicas + && replicas > 0 + { + selector_role_group = Some(role_group_name); + break; } } diff --git a/rust/operator-binary/src/webhooks/conversion.rs b/rust/operator-binary/src/webhooks/conversion.rs index 37aadf2b..6981ae86 100644 --- a/rust/operator-binary/src/webhooks/conversion.rs +++ b/rust/operator-binary/src/webhooks/conversion.rs @@ -40,7 +40,7 @@ pub async fn create_webhook_server( field_manager: FIELD_MANAGER.to_owned(), }; - let (conversion_webhook, _initial_reconcile_rx) = + let (conversion_webhook, _) = ConversionWebhook::new(crds_and_handlers, client, conversion_webhook_options); let webhook_server_options = WebhookServerOptions {