Skip to content

Commit 91b6730

Browse files
committed
chore: rustfmt
1 parent 4d81a5a commit 91b6730

4 files changed

Lines changed: 31 additions & 12 deletions

File tree

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,12 @@ pub fn build_merged_jvm_config(
9595
// OPA Java SDK.
9696
if let Some(authz_config) = authorization_config {
9797
if authz_config.has_opa_tls() {
98-
jvm_args.push(format!("-Djavax.net.ssl.trustStore={STACKABLE_SERVER_TLS_DIR}/truststore.p12"));
99-
jvm_args.push(format!("-Djavax.net.ssl.trustStorePassword={STACKABLE_TLS_STORE_PASSWORD}"));
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+
));
100104
jvm_args.push("-Djavax.net.ssl.trustStoreType=pkcs12".to_owned());
101105
}
102106
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ pub fn build_bootstrap_conf(
130130
bootstrap.extend(graceful_shutdown_config_properties(merged_config));
131131

132132
let merged_jvm_config =
133-
build_merged_jvm_config(merged_config, role, role_group, authorization_config).context(InvalidJVMConfigSnafu)?;
133+
build_merged_jvm_config(merged_config, role, role_group, authorization_config)
134+
.context(InvalidJVMConfigSnafu)?;
134135

135136
for (index, argument) in merged_jvm_config
136137
.effective_jvm_config_after_merging()

rust/operator-binary/src/controller.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,16 +1408,21 @@ async fn build_node_rolegroup_statefulset(
14081408
.add_empty_dir_volume(TRUSTSTORE_VOLUME_NAME, None)
14091409
.context(AddVolumeSnafu)?;
14101410

1411-
if let NifiAuthorizationConfig::Opa { secret_class: Some(secret_class), .. } = authorization_config
1411+
if let NifiAuthorizationConfig::Opa {
1412+
secret_class: Some(secret_class),
1413+
..
1414+
} = authorization_config
14121415
{
14131416
pod_builder
1414-
.add_volume(VolumeBuilder::new(OPA_TLS_VOLUME_NAME)
1415-
.ephemeral(
1416-
SecretOperatorVolumeSourceBuilder::new(secret_class)
1417-
.build()
1418-
.context(OpaTlsCertSecretClassVolumeBuildSnafu)?,
1417+
.add_volume(
1418+
VolumeBuilder::new(OPA_TLS_VOLUME_NAME)
1419+
.ephemeral(
1420+
SecretOperatorVolumeSourceBuilder::new(secret_class)
1421+
.build()
1422+
.context(OpaTlsCertSecretClassVolumeBuildSnafu)?,
1423+
)
1424+
.build(),
14191425
)
1420-
.build())
14211426
.context(AddVolumeSnafu)?;
14221427
}
14231428

rust/operator-binary/src/security/authorization.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ impl NifiAuthorizationConfig {
6161

6262
NifiAuthorizationConfig::Opa {
6363
configmap_name,
64-
cache_entry_time_to_live_secs: opa_config.cache.entry_time_to_live.as_secs(),
64+
cache_entry_time_to_live_secs: opa_config
65+
.cache
66+
.entry_time_to_live
67+
.as_secs(),
6568
cache_max_entries: opa_config.cache.max_entries,
6669
secret_class,
6770
}
@@ -188,6 +191,12 @@ impl NifiAuthorizationConfig {
188191
}
189192

190193
pub fn has_opa_tls(&self) -> bool {
191-
matches!(self, NifiAuthorizationConfig::Opa { secret_class: Some(_), .. })
194+
matches!(
195+
self,
196+
NifiAuthorizationConfig::Opa {
197+
secret_class: Some(_),
198+
..
199+
}
200+
)
192201
}
193202
}

0 commit comments

Comments
 (0)