Skip to content

Commit 2722435

Browse files
committed
fix: run linters
1 parent 660373f commit 2722435

5 files changed

Lines changed: 30 additions & 18 deletions

File tree

rust/operator-binary/src/controller.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ use stackable_operator::{
6767
use strum::{EnumDiscriminants, IntoStaticStr};
6868

6969
use crate::{
70+
controller::build::properties::logging::BundleBuilderLogLevel,
7071
crd::{
7172
APP_NAME, Container, DEFAULT_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT, OPERATOR_NAME,
7273
OpaClusterStatus, OpaConfig, OpaRole, user_info_fetcher, v1alpha2,
7374
},
74-
controller::build::properties::logging::BundleBuilderLogLevel,
7575
operations::graceful_shutdown::add_graceful_shutdown_config,
7676
service::{
7777
self, APP_PORT, APP_PORT_NAME, build_rolegroup_headless_service,
@@ -336,7 +336,8 @@ pub async fn reconcile_opa(
336336

337337
// NOTE(@maltesander): There currently is no dereference (client required) step for OPA.
338338
// validate (no client required)
339-
let validated = validate::validate(opa, &ctx.operator_environment).context(ValidateClusterSnafu)?;
339+
let validated =
340+
validate::validate(opa, &ctx.operator_environment).context(ValidateClusterSnafu)?;
340341

341342
let opa_role = OpaRole::Server;
342343

rust/operator-binary/src/controller/build/config_map.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,9 @@ pub fn build_rolegroup_config_map(
8686
cm_builder.add_data(VECTOR_CONFIG_FILE, vector_config);
8787
}
8888

89-
cm_builder
90-
.build()
91-
.with_context(|_| BuildConfigMapSnafu {
92-
rolegroup: rolegroup_ref.clone(),
93-
})
89+
cm_builder.build().with_context(|_| BuildConfigMapSnafu {
90+
rolegroup: rolegroup_ref.clone(),
91+
})
9492
}
9593

9694
#[cfg(test)]
@@ -100,8 +98,9 @@ mod tests {
10098

10199
use super::*;
102100
use crate::{
103-
controller::{build::properties::test_support::validated_cluster_from_spec,
104-
build_recommended_labels},
101+
controller::{
102+
build::properties::test_support::validated_cluster_from_spec, build_recommended_labels,
103+
},
105104
crd::OpaRole,
106105
};
107106

rust/operator-binary/src/controller/build/discovery.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ mod tests {
162162
data.get("OPA").map(String::as_str),
163163
Some("https://test-opa-server.default.svc.cluster.local:8443/")
164164
);
165-
assert_eq!(data.get("OPA_SECRET_CLASS").map(String::as_str), Some("tls"));
165+
assert_eq!(
166+
data.get("OPA_SECRET_CLASS").map(String::as_str),
167+
Some("tls")
168+
);
166169
}
167170
}

rust/operator-binary/src/controller/build/properties/config_json.rs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ pub fn build(merged_config: &OpaConfig, config_overrides: &OpaConfigOverrides) -
4949

5050
let config = OpaClusterConfigFile::new(decision_logging);
5151

52-
let config_value = serde_json::to_value(&config).with_context(|_| SerializeConfigFileSnafu {
53-
file: ConfigFileName::ConfigJson.to_string(),
54-
})?;
52+
let config_value =
53+
serde_json::to_value(&config).with_context(|_| SerializeConfigFileSnafu {
54+
file: ConfigFileName::ConfigJson.to_string(),
55+
})?;
5556

5657
// Apply the merged user `configOverrides`. The merge built a sequence that applies the
5758
// role-level patch first, then the role-group-level patch on top. `apply` is infallible; an
@@ -139,7 +140,9 @@ mod tests {
139140
use serde_json::{Value, json};
140141

141142
use super::*;
142-
use crate::{controller::build::properties::test_support::validated_cluster_from_spec, crd::OpaRole};
143+
use crate::{
144+
controller::build::properties::test_support::validated_cluster_from_spec, crd::OpaRole,
145+
};
143146

144147
/// Renders `config.json` for the `default` server role group of an `OpaCluster` built from
145148
/// `spec`, and parses it back into a [`Value`].
@@ -159,8 +162,14 @@ mod tests {
159162

160163
// The bundled stackable service and its default polling values.
161164
assert_eq!(config["services"][0]["name"], "stackable");
162-
assert_eq!(config["bundles"]["stackable"]["polling"]["min_delay_seconds"], 10);
163-
assert_eq!(config["bundles"]["stackable"]["polling"]["max_delay_seconds"], 20);
165+
assert_eq!(
166+
config["bundles"]["stackable"]["polling"]["min_delay_seconds"],
167+
10
168+
);
169+
assert_eq!(
170+
config["bundles"]["stackable"]["polling"]["max_delay_seconds"],
171+
20
172+
);
164173
// Prometheus status metrics are enabled, decision logs are off by default.
165174
assert_eq!(config["status"]["prometheus"], true);
166175
assert!(config.get("decision_logs").is_none_or(Value::is_null));

rust/operator-binary/src/controller/build/properties/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ pub(crate) mod test_support {
4848
image_repository: "oci.stackable.tech/sdp".to_string(),
4949
};
5050

51-
let validated =
52-
validate(&opa, &operator_environment).expect("validation should succeed for the fixture");
51+
let validated = validate(&opa, &operator_environment)
52+
.expect("validation should succeed for the fixture");
5353
(opa, validated)
5454
}
5555
}

0 commit comments

Comments
 (0)