Skip to content

Commit c6ed868

Browse files
committed
pass dereferenced struct rather than each field
1 parent a99b6d5 commit c6ed868

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

rust/operator-binary/src/controller/validate.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ use stackable_operator::{
1212
};
1313

1414
use crate::{
15+
controller::dereference::DereferencedObjects,
1516
crd::{AnyServiceConfig, HbaseRole, v1alpha1},
1617
hbase_controller::{CONTAINER_IMAGE_BASE_NAME, ValidatedCluster},
17-
security::opa::HbaseOpaConfig,
18-
zookeeper::ZookeeperConnectionInformation,
1918
};
2019

2120
#[derive(Snafu, Debug)]
@@ -65,8 +64,7 @@ pub fn validate_cluster(
6564
hbase: &v1alpha1::HbaseCluster,
6665
image_repository: &str,
6766
product_config_manager: &ProductConfigManager,
68-
zookeeper_connection_information: ZookeeperConnectionInformation,
69-
hbase_opa_config: Option<HbaseOpaConfig>,
67+
dereferenced_objects: DereferencedObjects,
7068
) -> Result<ValidatedCluster, Error> {
7169
let resolved_product_image = hbase
7270
.spec
@@ -132,7 +130,7 @@ pub fn validate_cluster(
132130
image: resolved_product_image,
133131
role_groups,
134132
role_configs,
135-
zookeeper_connection_information,
136-
hbase_opa_config,
133+
zookeeper_connection_information: dereferenced_objects.zookeeper_connection_information,
134+
hbase_opa_config: dereferenced_objects.hbase_opa_config,
137135
})
138136
}

rust/operator-binary/src/hbase_controller.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,16 +311,15 @@ pub async fn reconcile_hbase(
311311

312312
let client = &ctx.client;
313313

314-
let dereferenced = crate::controller::dereference::dereference(client, hbase)
314+
let dereferenced_objects = crate::controller::dereference::dereference(client, hbase)
315315
.await
316316
.context(DereferenceSnafu)?;
317317

318318
let validated = crate::controller::validate::validate_cluster(
319319
hbase,
320320
&ctx.operator_environment.image_repository,
321321
&ctx.product_config,
322-
dereferenced.zookeeper_connection_information,
323-
dereferenced.hbase_opa_config,
322+
dereferenced_objects,
324323
)
325324
.context(ValidateSnafu)?;
326325

0 commit comments

Comments
 (0)