diff --git a/Cargo.nix b/Cargo.nix index c41d291e..e0d5e27f 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -9780,7 +9780,7 @@ rec { "stackable-druid-operator" = rec { crateName = "stackable-druid-operator"; version = "0.0.0-dev"; - edition = "2021"; + edition = "2024"; crateBin = [ { name = "stackable-druid-operator"; diff --git a/Cargo.toml b/Cargo.toml index 3e7fa478..99226bcf 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/druid-operator" [workspace.dependencies] diff --git a/rust/operator-binary/src/crd/authentication.rs b/rust/operator-binary/src/crd/authentication.rs index 034723e5..081f0619 100644 --- a/rust/operator-binary/src/crd/authentication.rs +++ b/rust/operator-binary/src/crd/authentication.rs @@ -139,10 +139,9 @@ impl AuthenticationClassesResolved { Some(server_and_internal_secret_class) => { if let Some(auth_class_secret_class) = &provider.client_cert_secret_class + && auth_class_secret_class != server_and_internal_secret_class { - if auth_class_secret_class != server_and_internal_secret_class { - return TlsAuthenticationClassSecretClassDiffersFromDruidServerTlsSnafu { auth_class_name: auth_class_name.to_string(), server_and_internal_secret_class: server_and_internal_secret_class.clone() }.fail()?; - } + return TlsAuthenticationClassSecretClassDiffersFromDruidServerTlsSnafu { auth_class_name: auth_class_name.to_string(), server_and_internal_secret_class: server_and_internal_secret_class.clone() }.fail()?; } } None => { @@ -231,10 +230,10 @@ impl AuthenticationClassesResolved { } pub fn tls_authentication_enabled(&self) -> bool { - if !self.auth_classes.is_empty() { - if let Some(AuthenticationClassResolved::Tls { .. }) = self.auth_classes.first() { - return true; - } + if !self.auth_classes.is_empty() + && let Some(AuthenticationClassResolved::Tls { .. }) = self.auth_classes.first() + { + return true; } false } diff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs index 332db249..dadb1065 100644 --- a/rust/operator-binary/src/crd/mod.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -457,7 +457,7 @@ impl v1alpha1::DruidCluster { ( Vec, Role< - impl Configuration, + impl Configuration + use<>, DruidConfigOverrides, GenericRoleConfig, JavaCommonConfig, @@ -725,7 +725,7 @@ impl v1alpha1::DruidCluster { &self, druid_role: &DruidRole, ) -> Role< - impl Configuration, + impl Configuration + use<>, DruidConfigOverrides, GenericRoleConfig, JavaCommonConfig, @@ -1043,10 +1043,10 @@ impl DruidRole { ) -> Vec { let mut commands = vec![]; - if let Some(s3) = s3 { - if let Some(ca_cert_file) = s3.tls.tls_ca_cert_mount_path() { - commands.extend(add_cert_to_jvm_trust_store_cmd(&ca_cert_file)); - } + if let Some(s3) = s3 + && let Some(ca_cert_file) = s3.tls.tls_ca_cert_mount_path() + { + commands.extend(add_cert_to_jvm_trust_store_cmd(&ca_cert_file)); } // copy druid config to rw config diff --git a/rust/operator-binary/src/druid_controller.rs b/rust/operator-binary/src/druid_controller.rs index d7b7db8a..33c6cfcf 100644 --- a/rust/operator-binary/src/druid_controller.rs +++ b/rust/operator-binary/src/druid_controller.rs @@ -621,46 +621,46 @@ pub async fn reconcile_druid( ); } - if let Some(listener_class) = druid_role.listener_class_name(druid) { - if let Some(listener_group_name) = group_listener_name(druid, &druid_role) { - let role_group_listener = build_group_listener( + if let Some(listener_class) = druid_role.listener_class_name(druid) + && let Some(listener_group_name) = group_listener_name(druid, &druid_role) + { + let role_group_listener = build_group_listener( + druid, + build_recommended_labels( druid, - build_recommended_labels( - druid, - DRUID_CONTROLLER_NAME, - &resolved_product_image.app_version_label_value, - role_name, - "none", - ), - listener_class.to_string(), - listener_group_name, - &druid_role, - &druid_tls_security, - ) - .context(ListenerConfigurationSnafu)?; + DRUID_CONTROLLER_NAME, + &resolved_product_image.app_version_label_value, + role_name, + "none", + ), + listener_class.to_string(), + listener_group_name, + &druid_role, + &druid_tls_security, + ) + .context(ListenerConfigurationSnafu)?; - let listener = cluster_resources - .add(client, role_group_listener) - .await - .context(ApplyGroupListenerSnafu)?; + let listener = cluster_resources + .add(client, role_group_listener) + .await + .context(ApplyGroupListenerSnafu)?; - if druid_role == DruidRole::Router { - // discovery - for discovery_cm in build_discovery_configmaps( - druid, - druid, - &resolved_product_image, - &druid_tls_security, - listener, - ) - .await - .context(BuildDiscoveryConfigSnafu)? - { - cluster_resources - .add(client, discovery_cm) - .await - .context(ApplyDiscoveryConfigSnafu)?; - } + if druid_role == DruidRole::Router { + // discovery + for discovery_cm in build_discovery_configmaps( + druid, + druid, + &resolved_product_image, + &druid_tls_security, + listener, + ) + .await + .context(BuildDiscoveryConfigSnafu)? + { + cluster_resources + .add(client, discovery_cm) + .await + .context(ApplyDiscoveryConfigSnafu)?; } } } diff --git a/rust/operator-binary/src/webhooks/conversion.rs b/rust/operator-binary/src/webhooks/conversion.rs index 474a243f..4b1a608c 100644 --- a/rust/operator-binary/src/webhooks/conversion.rs +++ b/rust/operator-binary/src/webhooks/conversion.rs @@ -37,7 +37,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 {