@@ -6,10 +6,7 @@ use stackable_operator::{
66 PodBuilder ,
77 resources:: ResourceRequirementsBuilder ,
88 security:: PodSecurityContextBuilder ,
9- volume:: {
10- ListenerOperatorVolumeSourceBuilder , ListenerOperatorVolumeSourceBuilderError ,
11- ListenerReference , VolumeBuilder ,
12- } ,
9+ volume:: VolumeBuilder ,
1310 } ,
1411 } ,
1512 crd:: git_sync,
@@ -25,7 +22,13 @@ use stackable_operator::{
2522 kvp:: { Annotation , Label , LabelError } ,
2623 utils:: COMMON_BASH_TRAP_FUNCTIONS ,
2724 v2:: {
28- builder:: { meta:: ownerreference_from_resource, pod:: container:: new_container_builder} ,
25+ builder:: {
26+ meta:: ownerreference_from_resource,
27+ pod:: {
28+ container:: new_container_builder,
29+ volume:: { ListenerReference , listener_operator_volume_source_builder_build_pvc} ,
30+ } ,
31+ } ,
2932 types:: operator:: RoleGroupName ,
3033 } ,
3134} ;
@@ -48,7 +51,7 @@ use crate::{
4851 controller_commons:: { self , CONFIG_VOLUME_NAME , LOG_CONFIG_VOLUME_NAME , LOG_VOLUME_NAME } ,
4952 crd:: {
5053 AirflowExecutor , AirflowRole , CONFIG_PATH , Container , HTTP_PORT_NAME , LISTENER_VOLUME_DIR ,
51- LISTENER_VOLUME_NAME , LOG_CONFIG_DIR , METRICS_CONTAINER_NAME , METRICS_PORT ,
54+ LISTENER_PVC_NAME , LOG_CONFIG_DIR , METRICS_CONTAINER_NAME , METRICS_PORT ,
5255 METRICS_PORT_NAME , STACKABLE_LOG_DIR , TEMPLATE_LOCATION , TEMPLATE_VOLUME_NAME ,
5356 } ,
5457} ;
@@ -77,11 +80,6 @@ pub enum Error {
7780 #[ snafu( display( "failed to build Statefulset environmental variables" ) ) ]
7881 BuildStatefulsetEnvVars { source : env_vars:: Error } ,
7982
80- #[ snafu( display( "failed to build listener volume" ) ) ]
81- BuildListenerVolume {
82- source : ListenerOperatorVolumeSourceBuilderError ,
83- } ,
84-
8583 #[ snafu( display( "failed to build shared pod resources" ) ) ]
8684 Pod {
8785 source : crate :: controller:: build:: resource:: pod:: Error ,
@@ -237,16 +235,15 @@ pub fn build_server_rolegroup_statefulset(
237235 // so that load balancers can hard-code the target addresses. This will
238236 // be the case even when no class is set (and the value defaults to
239237 // cluster-internal) as the address should still be consistent.
240- let pvc = ListenerOperatorVolumeSourceBuilder :: new (
241- & ListenerReference :: ListenerName ( listener_group_name. to_string ( ) ) ,
238+ let pvc = listener_operator_volume_source_builder_build_pvc (
239+ & ListenerReference :: Listener ( listener_group_name) ,
242240 & unversioned_recommended_labels,
243- )
244- . build_pvc ( LISTENER_VOLUME_NAME . to_string ( ) )
245- . context ( BuildListenerVolumeSnafu ) ?;
241+ & LISTENER_PVC_NAME ,
242+ ) ;
246243 pvcs = Some ( vec ! [ pvc] ) ;
247244
248245 airflow_container
249- . add_volume_mount ( & * LISTENER_VOLUME_NAME , LISTENER_VOLUME_DIR )
246+ . add_volume_mount ( & * LISTENER_PVC_NAME , LISTENER_VOLUME_DIR )
250247 . context ( AddVolumeMountSnafu ) ?;
251248 }
252249
0 commit comments