@@ -40,7 +40,7 @@ use stackable_operator::{
4040 product_logging:: framework:: {
4141 STACKABLE_LOG_DIR , ValidatedContainerLogConfigChoice , vector_container,
4242 } ,
43- types:: kubernetes:: { ContainerName , PersistentVolumeClaimName , VolumeName } ,
43+ types:: kubernetes:: { PersistentVolumeClaimName , VolumeName } ,
4444 } ,
4545} ;
4646
@@ -58,10 +58,10 @@ use crate::{
5858 } ,
5959 } ,
6060 crd:: {
61- HIVE_PORT , HIVE_PORT_NAME , HiveRole , METRICS_PORT , METRICS_PORT_NAME , STACKABLE_CONFIG_DIR ,
62- STACKABLE_CONFIG_DIR_NAME , STACKABLE_CONFIG_MOUNT_DIR , STACKABLE_CONFIG_MOUNT_DIR_NAME ,
63- STACKABLE_LOG_CONFIG_MOUNT_DIR , STACKABLE_LOG_CONFIG_MOUNT_DIR_NAME ,
64- STACKABLE_LOG_DIR_NAME ,
61+ Container , HIVE_PORT , HIVE_PORT_NAME , HiveRole , METRICS_PORT , METRICS_PORT_NAME ,
62+ STACKABLE_CONFIG_DIR , STACKABLE_CONFIG_DIR_NAME , STACKABLE_CONFIG_MOUNT_DIR ,
63+ STACKABLE_CONFIG_MOUNT_DIR_NAME , STACKABLE_LOG_CONFIG_MOUNT_DIR ,
64+ STACKABLE_LOG_CONFIG_MOUNT_DIR_NAME , STACKABLE_LOG_DIR_NAME ,
6565 } ,
6666} ;
6767
@@ -110,14 +110,8 @@ pub enum Error {
110110
111111type Result < T , E = Error > = std:: result:: Result < T , E > ;
112112
113- stackable_operator:: constant!( VECTOR_CONTAINER_NAME : ContainerName = "vector" ) ;
114-
115- // The main Hive container's name. Reuses the `APP_NAME` value (`hive`) so the produced
116- // Container `name` is unchanged.
117- stackable_operator:: constant!( HIVE_CONTAINER_NAME : ContainerName = "hive" ) ;
118-
119- // Typed name for the listener-operator PersistentVolumeClaim. Reuses the existing
120- // `LISTENER_VOLUME_NAME` string value (`listener`) so the produced PVC name is unchanged.
113+ // Typed name for the listener-operator PersistentVolumeClaim. The volume mount that exposes the
114+ // PVC reuses this same name, since a volume mount references its claim by name.
121115stackable_operator:: constant!( LISTENER_PVC_NAME : PersistentVolumeClaimName = "listener" ) ;
122116
123117// Typed `VolumeName`s for the Vector container's log-config and log volumes. These reuse the
@@ -126,8 +120,7 @@ stackable_operator::constant!(LISTENER_PVC_NAME: PersistentVolumeClaimName = "li
126120stackable_operator:: constant!( VECTOR_LOG_CONFIG_VOLUME_NAME : VolumeName = "config-mount" ) ;
127121stackable_operator:: constant!( VECTOR_LOG_VOLUME_NAME : VolumeName = "log" ) ;
128122
129- // Listener volumes (consumed by the listener-operator PVC and its volume mount below).
130- pub const LISTENER_VOLUME_NAME : & str = "listener" ;
123+ // Mount path of the listener volume (consumed by the listener-operator PVC's volume mount below).
131124pub const LISTENER_VOLUME_DIR : & str = "/stackable/listener" ;
132125
133126// Typed name for the HDFS discovery ConfigMap volume, reusing the existing `"hdfs-discovery"`
@@ -157,7 +150,7 @@ pub(crate) fn build_metastore_rolegroup_statefulset(
157150 let merged_config = & rg. config ;
158151 let hive_opa_config = cluster. cluster_config . hive_opa_config . as_ref ( ) ;
159152
160- let mut container_builder = new_container_builder ( & HIVE_CONTAINER_NAME ) ;
153+ let mut container_builder = new_container_builder ( & Container :: Hive . to_container_name ( ) ) ;
161154
162155 container_builder
163156 . add_env_var (
@@ -282,14 +275,17 @@ pub(crate) fn build_metastore_rolegroup_statefulset(
282275 s3_connection,
283276 hive_opa_config,
284277 ) )
285- . add_volume_mount ( STACKABLE_CONFIG_DIR_NAME , STACKABLE_CONFIG_DIR )
278+ . add_volume_mount ( & * STACKABLE_CONFIG_DIR_NAME , STACKABLE_CONFIG_DIR )
286279 . context ( AddVolumeMountSnafu ) ?
287- . add_volume_mount ( STACKABLE_CONFIG_MOUNT_DIR_NAME , STACKABLE_CONFIG_MOUNT_DIR )
280+ . add_volume_mount (
281+ & * STACKABLE_CONFIG_MOUNT_DIR_NAME ,
282+ STACKABLE_CONFIG_MOUNT_DIR ,
283+ )
288284 . context ( AddVolumeMountSnafu ) ?
289- . add_volume_mount ( STACKABLE_LOG_DIR_NAME , STACKABLE_LOG_DIR )
285+ . add_volume_mount ( & * STACKABLE_LOG_DIR_NAME , STACKABLE_LOG_DIR )
290286 . context ( AddVolumeMountSnafu ) ?
291287 . add_volume_mount (
292- STACKABLE_LOG_CONFIG_MOUNT_DIR_NAME ,
288+ & * STACKABLE_LOG_CONFIG_MOUNT_DIR_NAME ,
293289 STACKABLE_LOG_CONFIG_MOUNT_DIR ,
294290 )
295291 . context ( AddVolumeMountSnafu ) ?
@@ -344,7 +340,7 @@ pub(crate) fn build_metastore_rolegroup_statefulset(
344340 ) ;
345341
346342 container_builder
347- . add_volume_mount ( LISTENER_VOLUME_NAME , LISTENER_VOLUME_DIR )
343+ . add_volume_mount ( & * LISTENER_PVC_NAME , LISTENER_VOLUME_DIR )
348344 . context ( AddVolumeMountSnafu ) ?;
349345
350346 pod_builder
@@ -369,7 +365,7 @@ pub(crate) fn build_metastore_rolegroup_statefulset(
369365 } )
370366 . context ( AddVolumeSnafu ) ?
371367 . add_empty_dir_volume (
372- STACKABLE_LOG_DIR_NAME ,
368+ & * STACKABLE_LOG_DIR_NAME ,
373369 Some ( product_logging:: framework:: calculate_log_volume_size_limit (
374370 & [ MAX_HIVE_LOG_FILES_SIZE ] ,
375371 ) ) ,
@@ -413,7 +409,7 @@ pub(crate) fn build_metastore_rolegroup_statefulset(
413409 // default, is started first and can provide any dependencies that vector expects
414410 if let Some ( vector_log_config) = & rg. config . logging . vector_container {
415411 pod_builder. add_container ( vector_container (
416- & VECTOR_CONTAINER_NAME ,
412+ & Container :: Vector . to_container_name ( ) ,
417413 resolved_product_image,
418414 vector_log_config,
419415 & resource_names,
0 commit comments