1
- //! Ensures that `Pod`s are configured and running for each [`HiveCluster`]
1
+ //! Ensures that `Pod`s are configured and running for each [`v1alpha1::HiveCluster`]
2
+
2
3
use std:: {
3
4
borrow:: Cow ,
4
5
collections:: { BTreeMap , HashMap } ,
@@ -15,14 +16,6 @@ use product_config::{
15
16
ProductConfigManager ,
16
17
} ;
17
18
use snafu:: { OptionExt , ResultExt , Snafu } ;
18
- use stackable_hive_crd:: {
19
- Container , HiveCluster , HiveClusterStatus , HiveRole , MetaStoreConfig , APP_NAME , CORE_SITE_XML ,
20
- DB_PASSWORD_ENV , DB_USERNAME_ENV , HADOOP_HEAPSIZE , HIVE_ENV_SH , HIVE_PORT , HIVE_PORT_NAME ,
21
- HIVE_SITE_XML , JVM_HEAP_FACTOR , JVM_SECURITY_PROPERTIES_FILE , METRICS_PORT , METRICS_PORT_NAME ,
22
- STACKABLE_CONFIG_DIR , STACKABLE_CONFIG_DIR_NAME , STACKABLE_CONFIG_MOUNT_DIR ,
23
- STACKABLE_CONFIG_MOUNT_DIR_NAME , STACKABLE_LOG_CONFIG_MOUNT_DIR ,
24
- STACKABLE_LOG_CONFIG_MOUNT_DIR_NAME , STACKABLE_LOG_DIR , STACKABLE_LOG_DIR_NAME ,
25
- } ;
26
19
use stackable_operator:: {
27
20
builder:: {
28
21
self ,
@@ -86,6 +79,15 @@ use tracing::warn;
86
79
87
80
use crate :: {
88
81
command:: build_container_command_args,
82
+ crd:: {
83
+ v1alpha1, Container , HiveClusterStatus , HiveRole , MetaStoreConfig , APP_NAME , CORE_SITE_XML ,
84
+ DB_PASSWORD_ENV , DB_USERNAME_ENV , HADOOP_HEAPSIZE , HIVE_ENV_SH , HIVE_PORT , HIVE_PORT_NAME ,
85
+ HIVE_SITE_XML , JVM_HEAP_FACTOR , JVM_SECURITY_PROPERTIES_FILE , METRICS_PORT ,
86
+ METRICS_PORT_NAME , STACKABLE_CONFIG_DIR , STACKABLE_CONFIG_DIR_NAME ,
87
+ STACKABLE_CONFIG_MOUNT_DIR , STACKABLE_CONFIG_MOUNT_DIR_NAME ,
88
+ STACKABLE_LOG_CONFIG_MOUNT_DIR , STACKABLE_LOG_CONFIG_MOUNT_DIR_NAME , STACKABLE_LOG_DIR ,
89
+ STACKABLE_LOG_DIR_NAME ,
90
+ } ,
89
91
discovery,
90
92
kerberos:: {
91
93
self , add_kerberos_pod_config, kerberos_config_properties,
@@ -128,7 +130,7 @@ pub enum Error {
128
130
129
131
#[ snafu( display( "failed to calculate service name for role {rolegroup}" ) ) ]
130
132
RoleGroupServiceNameNotFound {
131
- rolegroup : RoleGroupRef < HiveCluster > ,
133
+ rolegroup : RoleGroupRef < v1alpha1 :: HiveCluster > ,
132
134
} ,
133
135
134
136
#[ snafu( display( "failed to apply global Service" ) ) ]
@@ -139,25 +141,25 @@ pub enum Error {
139
141
#[ snafu( display( "failed to apply Service for {rolegroup}" ) ) ]
140
142
ApplyRoleGroupService {
141
143
source : stackable_operator:: cluster_resources:: Error ,
142
- rolegroup : RoleGroupRef < HiveCluster > ,
144
+ rolegroup : RoleGroupRef < v1alpha1 :: HiveCluster > ,
143
145
} ,
144
146
145
147
#[ snafu( display( "failed to build ConfigMap for {rolegroup}" ) ) ]
146
148
BuildRoleGroupConfig {
147
149
source : stackable_operator:: builder:: configmap:: Error ,
148
- rolegroup : RoleGroupRef < HiveCluster > ,
150
+ rolegroup : RoleGroupRef < v1alpha1 :: HiveCluster > ,
149
151
} ,
150
152
151
153
#[ snafu( display( "failed to apply ConfigMap for {rolegroup}" ) ) ]
152
154
ApplyRoleGroupConfig {
153
155
source : stackable_operator:: cluster_resources:: Error ,
154
- rolegroup : RoleGroupRef < HiveCluster > ,
156
+ rolegroup : RoleGroupRef < v1alpha1 :: HiveCluster > ,
155
157
} ,
156
158
157
159
#[ snafu( display( "failed to apply StatefulSet for {rolegroup}" ) ) ]
158
160
ApplyRoleGroupStatefulSet {
159
161
source : stackable_operator:: cluster_resources:: Error ,
160
- rolegroup : RoleGroupRef < HiveCluster > ,
162
+ rolegroup : RoleGroupRef < v1alpha1 :: HiveCluster > ,
161
163
} ,
162
164
163
165
#[ snafu( display( "failed to generate product config" ) ) ]
@@ -200,7 +202,7 @@ pub enum Error {
200
202
S3TlsNoVerificationNotSupported ,
201
203
202
204
#[ snafu( display( "failed to resolve and merge resource config for role and role group" ) ) ]
203
- FailedToResolveResourceConfig { source : stackable_hive_crd :: Error } ,
205
+ FailedToResolveResourceConfig { source : crate :: crd :: Error } ,
204
206
205
207
#[ snafu( display( "invalid java heap config - missing default or value in crd?" ) ) ]
206
208
InvalidJavaHeapConfig ,
@@ -254,7 +256,7 @@ pub enum Error {
254
256
} ,
255
257
256
258
#[ snafu( display( "internal operator failure" ) ) ]
257
- InternalOperatorError { source : stackable_hive_crd :: Error } ,
259
+ InternalOperatorError { source : crate :: crd :: Error } ,
258
260
259
261
#[ snafu( display(
260
262
"failed to serialize [{JVM_SECURITY_PROPERTIES_FILE}] for {}" ,
@@ -336,7 +338,7 @@ impl ReconcilerError for Error {
336
338
}
337
339
338
340
pub async fn reconcile_hive (
339
- hive : Arc < DeserializeGuard < HiveCluster > > ,
341
+ hive : Arc < DeserializeGuard < v1alpha1 :: HiveCluster > > ,
340
342
ctx : Arc < Ctx > ,
341
343
) -> Result < Action > {
342
344
tracing:: info!( "Starting reconcile" ) ;
@@ -554,7 +556,7 @@ pub async fn reconcile_hive(
554
556
/// The server-role service is the primary endpoint that should be used by clients that do not
555
557
/// perform internal load balancing including targets outside of the cluster.
556
558
pub fn build_metastore_role_service (
557
- hive : & HiveCluster ,
559
+ hive : & v1alpha1 :: HiveCluster ,
558
560
resolved_product_image : & ResolvedProductImage ,
559
561
) -> Result < Service > {
560
562
let role_name = HiveRole :: MetaStore . to_string ( ) ;
@@ -593,10 +595,10 @@ pub fn build_metastore_role_service(
593
595
/// The rolegroup [`ConfigMap`] configures the rolegroup based on the configuration given by the administrator
594
596
#[ allow( clippy:: too_many_arguments) ]
595
597
fn build_metastore_rolegroup_config_map (
596
- hive : & HiveCluster ,
598
+ hive : & v1alpha1 :: HiveCluster ,
597
599
hive_namespace : & str ,
598
600
resolved_product_image : & ResolvedProductImage ,
599
- rolegroup : & RoleGroupRef < HiveCluster > ,
601
+ rolegroup : & RoleGroupRef < v1alpha1 :: HiveCluster > ,
600
602
role_group_config : & HashMap < PropertyNameKind , BTreeMap < String , String > > ,
601
603
s3_connection_spec : Option < & S3ConnectionSpec > ,
602
604
merged_config : & MetaStoreConfig ,
@@ -766,9 +768,9 @@ fn build_metastore_rolegroup_config_map(
766
768
///
767
769
/// This is mostly useful for internal communication between peers, or for clients that perform client-side load balancing.
768
770
fn build_rolegroup_service (
769
- hive : & HiveCluster ,
771
+ hive : & v1alpha1 :: HiveCluster ,
770
772
resolved_product_image : & ResolvedProductImage ,
771
- rolegroup : & RoleGroupRef < HiveCluster > ,
773
+ rolegroup : & RoleGroupRef < v1alpha1 :: HiveCluster > ,
772
774
) -> Result < Service > {
773
775
Ok ( Service {
774
776
metadata : ObjectMetaBuilder :: new ( )
@@ -808,10 +810,10 @@ fn build_rolegroup_service(
808
810
/// corresponding [`Service`] (from [`build_rolegroup_service`]).
809
811
#[ allow( clippy:: too_many_arguments) ]
810
812
fn build_metastore_rolegroup_statefulset (
811
- hive : & HiveCluster ,
813
+ hive : & v1alpha1 :: HiveCluster ,
812
814
hive_role : & HiveRole ,
813
815
resolved_product_image : & ResolvedProductImage ,
814
- rolegroup_ref : & RoleGroupRef < HiveCluster > ,
816
+ rolegroup_ref : & RoleGroupRef < v1alpha1 :: HiveCluster > ,
815
817
metastore_config : & HashMap < PropertyNameKind , BTreeMap < String , String > > ,
816
818
s3_connection : Option < & S3ConnectionSpec > ,
817
819
merged_config : & MetaStoreConfig ,
@@ -1143,7 +1145,7 @@ fn env_var_from_secret(var_name: &str, secret: &str, secret_key: &str) -> EnvVar
1143
1145
}
1144
1146
1145
1147
pub fn error_policy (
1146
- _obj : Arc < DeserializeGuard < HiveCluster > > ,
1148
+ _obj : Arc < DeserializeGuard < v1alpha1 :: HiveCluster > > ,
1147
1149
error : & Error ,
1148
1150
_ctx : Arc < Ctx > ,
1149
1151
) -> Action {
0 commit comments