Skip to content

Commit 47feb65

Browse files
committed
move related structs togetherin controller
1 parent 9011ec2 commit 47feb65

2 files changed

Lines changed: 20 additions & 21 deletions

File tree

rust/operator-binary/src/controller.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ use crate::{
9292
jvm::{construct_hadoop_heapsize_env, construct_non_heap_jvm_args},
9393
opa::{HiveOpaConfig, OPA_TLS_VOLUME_NAME},
9494
},
95-
controller::validate::{ValidatedRoleConfig, ValidatedRoleGroupConfig},
9695
crd::{
9796
APP_NAME, CORE_SITE_XML, Container, HIVE_PORT, HIVE_PORT_NAME, HIVE_SITE_XML,
9897
HiveClusterStatus, HiveRole, JVM_SECURITY_PROPERTIES_FILE, METRICS_PORT, METRICS_PORT_NAME,
@@ -339,6 +338,20 @@ pub struct ValidatedCluster {
339338
pub hive_opa_config: Option<HiveOpaConfig>,
340339
}
341340

341+
/// Per-role configuration extracted during validation.
342+
#[derive(Clone, Debug)]
343+
pub struct ValidatedRoleConfig {
344+
pub pdb: stackable_operator::commons::pdb::PdbConfig,
345+
pub listener_class: String,
346+
}
347+
348+
/// Per-rolegroup configuration: the merged CRD config plus the product-config properties.
349+
#[derive(Clone, Debug)]
350+
pub struct ValidatedRoleGroupConfig {
351+
pub merged_config: MetaStoreConfig,
352+
pub product_config_properties: HashMap<PropertyNameKind, BTreeMap<String, String>>,
353+
}
354+
342355
pub async fn reconcile_hive(
343356
hive: Arc<DeserializeGuard<v1alpha1::HiveCluster>>,
344357
ctx: Arc<Ctx>,

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

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
use std::{
2-
borrow::Cow,
3-
collections::{BTreeMap, HashMap},
4-
};
1+
use std::{borrow::Cow, collections::BTreeMap};
52

63
use product_config::{ProductConfigManager, types::PropertyNameKind};
74
use snafu::{OptionExt, ResultExt, Snafu};
@@ -12,9 +9,12 @@ use stackable_operator::{
129
};
1310

1411
use crate::{
15-
controller::{CONTAINER_IMAGE_BASE_NAME, ValidatedCluster, dereference::DereferencedObjects},
12+
controller::{
13+
CONTAINER_IMAGE_BASE_NAME, ValidatedCluster, ValidatedRoleConfig, ValidatedRoleGroupConfig,
14+
dereference::DereferencedObjects,
15+
},
1616
crd::{
17-
HIVE_SITE_XML, HiveRole, JVM_SECURITY_PROPERTIES_FILE, MetaStoreConfig,
17+
HIVE_SITE_XML, HiveRole, JVM_SECURITY_PROPERTIES_FILE,
1818
v1alpha1::{self, HiveMetastoreRoleConfig},
1919
},
2020
};
@@ -48,20 +48,6 @@ pub enum Error {
4848
},
4949
}
5050

51-
/// Per-role configuration extracted during validation.
52-
#[derive(Clone, Debug)]
53-
pub struct ValidatedRoleConfig {
54-
pub pdb: stackable_operator::commons::pdb::PdbConfig,
55-
pub listener_class: String,
56-
}
57-
58-
/// Per-rolegroup configuration: the merged CRD config plus the product-config properties.
59-
#[derive(Clone, Debug)]
60-
pub struct ValidatedRoleGroupConfig {
61-
pub merged_config: MetaStoreConfig,
62-
pub product_config_properties: HashMap<PropertyNameKind, BTreeMap<String, String>>,
63-
}
64-
6551
pub fn validate_cluster(
6652
hive: &v1alpha1::HiveCluster,
6753
image_repository: &str,

0 commit comments

Comments
 (0)