Skip to content

Commit 52fbcaf

Browse files
committed
pass dereferenced struct rather than each field
1 parent 3f41681 commit 52fbcaf

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

rust/operator-binary/src/controller.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,16 +352,15 @@ pub async fn reconcile_hive(
352352
let client = &ctx.client;
353353
let hive_namespace = hive.namespace().context(ObjectHasNoNamespaceSnafu)?;
354354

355-
let dereferenced = crate::controller::dereference::dereference(client, hive)
355+
let dereferenced_objects = crate::controller::dereference::dereference(client, hive)
356356
.await
357357
.context(DereferenceSnafu)?;
358358

359359
let validated = validate::validate_cluster(
360360
hive,
361361
&ctx.operator_environment.image_repository,
362362
&ctx.product_config,
363-
dereferenced.s3_connection_spec,
364-
dereferenced.hive_opa_config,
363+
dereferenced_objects,
365364
)
366365
.context(ValidateSnafu)?;
367366

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ use product_config::{ProductConfigManager, types::PropertyNameKind};
77
use snafu::{OptionExt, ResultExt, Snafu};
88
use stackable_operator::{
99
commons::product_image_selection,
10-
crd::s3,
1110
product_config_utils::{transform_all_roles_to_config, validate_all_roles_and_groups_config},
1211
role_utils::GenericRoleConfig,
1312
};
1413

1514
use crate::{
16-
config::opa::HiveOpaConfig,
17-
controller::{CONTAINER_IMAGE_BASE_NAME, ValidatedCluster},
15+
controller::{CONTAINER_IMAGE_BASE_NAME, ValidatedCluster, dereference::DereferencedObjects},
1816
crd::{
1917
HIVE_SITE_XML, HiveRole, JVM_SECURITY_PROPERTIES_FILE, MetaStoreConfig,
2018
v1alpha1::{self, HiveMetastoreRoleConfig},
@@ -68,8 +66,7 @@ pub fn validate_cluster(
6866
hive: &v1alpha1::HiveCluster,
6967
image_repository: &str,
7068
product_config_manager: &ProductConfigManager,
71-
s3_connection_spec: Option<s3::v1alpha1::ConnectionSpec>,
72-
hive_opa_config: Option<HiveOpaConfig>,
69+
dereferenced_objects: DereferencedObjects,
7370
) -> Result<ValidatedCluster, Error> {
7471
let resolved_product_image = hive
7572
.spec
@@ -159,7 +156,7 @@ pub fn validate_cluster(
159156
role_groups: group_configs,
160157
role_config,
161158
metadata_database_connection_details,
162-
s3_connection_spec,
163-
hive_opa_config,
159+
s3_connection_spec: dereferenced_objects.s3_connection_spec,
160+
hive_opa_config: dereferenced_objects.hive_opa_config,
164161
})
165162
}

0 commit comments

Comments
 (0)