Skip to content

Commit dc220f9

Browse files
committed
Merge remote-tracking branch 'origin/main' into refactor/remove-product-config
2 parents afbbbfb + e5253f6 commit dc220f9

6 files changed

Lines changed: 44 additions & 45 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/druid-operator"
1111

1212
[workspace.dependencies]

rust/operator-binary/src/controller.rs

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -418,40 +418,40 @@ pub async fn reconcile_druid(
418418
);
419419
}
420420

421-
if let Some(listener_class) = druid_role.listener_class_name(druid) {
422-
if let Some(listener_group_name) = group_listener_name(druid, druid_role) {
423-
let role_group_listener = build_group_listener(
421+
if let Some(listener_class) = druid_role.listener_class_name(druid)
422+
&& let Some(listener_group_name) = group_listener_name(druid, druid_role)
423+
{
424+
let role_group_listener = build_group_listener(
425+
druid,
426+
build_recommended_labels(
424427
druid,
425-
build_recommended_labels(
426-
druid,
427-
DRUID_CONTROLLER_NAME,
428-
&validated_cluster.image.app_version_label_value,
429-
&role_name,
430-
"none",
431-
),
432-
listener_class.to_string(),
433-
listener_group_name,
434-
druid_role,
435-
&validated_cluster.cluster_config.druid_tls_security,
436-
)
437-
.context(ListenerConfigurationSnafu)?;
438-
439-
let listener = cluster_resources
440-
.add(client, role_group_listener)
441-
.await
442-
.context(ApplyGroupListenerSnafu)?;
428+
DRUID_CONTROLLER_NAME,
429+
&validated_cluster.image.app_version_label_value,
430+
&role_name,
431+
"none",
432+
),
433+
listener_class.to_string(),
434+
listener_group_name,
435+
druid_role,
436+
&validated_cluster.cluster_config.druid_tls_security,
437+
)
438+
.context(ListenerConfigurationSnafu)?;
443439

444-
if *druid_role == DruidRole::Router {
445-
// discovery
446-
for discovery_cm in build_discovery_configmaps(&validated_cluster, listener)
440+
let listener = cluster_resources
441+
.add(client, role_group_listener)
442+
.await
443+
.context(ApplyGroupListenerSnafu)?;
444+
445+
if *druid_role == DruidRole::Router {
446+
// discovery
447+
for discovery_cm in build_discovery_configmaps(&validated_cluster, listener)
448+
.await
449+
.context(BuildDiscoveryConfigSnafu)?
450+
{
451+
cluster_resources
452+
.add(client, discovery_cm)
447453
.await
448-
.context(BuildDiscoveryConfigSnafu)?
449-
{
450-
cluster_resources
451-
.add(client, discovery_cm)
452-
.await
453-
.context(ApplyDiscoveryConfigSnafu)?;
454-
}
454+
.context(ApplyDiscoveryConfigSnafu)?;
455455
}
456456
}
457457
}

rust/operator-binary/src/crd/authentication.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,9 @@ impl AuthenticationClassesResolved {
139139
Some(server_and_internal_secret_class) => {
140140
if let Some(auth_class_secret_class) =
141141
&provider.client_cert_secret_class
142+
&& auth_class_secret_class != server_and_internal_secret_class
142143
{
143-
if auth_class_secret_class != server_and_internal_secret_class {
144-
return TlsAuthenticationClassSecretClassDiffersFromDruidServerTlsSnafu { auth_class_name: auth_class_name.to_string(), server_and_internal_secret_class: server_and_internal_secret_class.clone() }.fail()?;
145-
}
144+
return TlsAuthenticationClassSecretClassDiffersFromDruidServerTlsSnafu { auth_class_name: auth_class_name.to_string(), server_and_internal_secret_class: server_and_internal_secret_class.clone() }.fail()?;
146145
}
147146
}
148147
None => {
@@ -231,10 +230,10 @@ impl AuthenticationClassesResolved {
231230
}
232231

233232
pub fn tls_authentication_enabled(&self) -> bool {
234-
if !self.auth_classes.is_empty() {
235-
if let Some(AuthenticationClassResolved::Tls { .. }) = self.auth_classes.first() {
236-
return true;
237-
}
233+
if !self.auth_classes.is_empty()
234+
&& let Some(AuthenticationClassResolved::Tls { .. }) = self.auth_classes.first()
235+
{
236+
return true;
238237
}
239238
false
240239
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -679,10 +679,10 @@ impl DruidRole {
679679
) -> Vec<String> {
680680
let mut commands = vec![];
681681

682-
if let Some(s3) = s3 {
683-
if let Some(ca_cert_file) = s3.tls.tls_ca_cert_mount_path() {
684-
commands.extend(add_cert_to_jvm_trust_store_cmd(&ca_cert_file));
685-
}
682+
if let Some(s3) = s3
683+
&& let Some(ca_cert_file) = s3.tls.tls_ca_cert_mount_path()
684+
{
685+
commands.extend(add_cert_to_jvm_trust_store_cmd(&ca_cert_file));
686686
}
687687

688688
// copy druid config to rw config

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

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

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

4545
let webhook_server_options = WebhookServerOptions {

0 commit comments

Comments
 (0)