@@ -67,7 +67,6 @@ use crate::{
6767 storage:: { NifiRepository , PERSISTENT_REPOSITORIES } ,
6868 v1alpha1,
6969 } ,
70- nifi_controller:: LOG_VOLUME_NAME ,
7170 security:: {
7271 authentication:: {
7372 NifiAuthenticationConfig , STACKABLE_SERVER_TLS_DIR , STACKABLE_TLS_STORE_PASSWORD ,
@@ -134,6 +133,26 @@ type Result<T, E = Error> = std::result::Result<T, E>;
134133
135134const USERDATA_MOUNTPOINT : & str = "/stackable/userdata" ;
136135
136+ /// Volume providing the rendered NiFi config (the `conf` ConfigMap), mounted into the prepare
137+ /// container which templates it into [`ACTIVE_CONFIG_VOLUME_NAME`].
138+ const CONFIG_VOLUME_NAME : & str = "conf" ;
139+ const CONFIG_VOLUME_MOUNT : & str = "/conf" ;
140+
141+ /// `emptyDir` holding the live config templated by the prepare container and shared with the NiFi
142+ /// container.
143+ const ACTIVE_CONFIG_VOLUME_NAME : & str = "activeconf" ;
144+
145+ /// Volume holding the generated sensitive-properties key.
146+ const SENSITIVE_PROPERTY_VOLUME_NAME : & str = "sensitiveproperty" ;
147+ const SENSITIVE_PROPERTY_VOLUME_MOUNT : & str = "/stackable/sensitiveproperty" ;
148+
149+ /// Volume providing the log config (logback/log4j) ConfigMap.
150+ const LOG_CONFIG_VOLUME_NAME : & str = "log-config" ;
151+
152+ /// Volume the NiFi logs are written to and shared with the Vector sidecar (also used by the
153+ /// git-sync container, see [`crate::controller::build::git_sync`]).
154+ pub ( crate ) const LOG_VOLUME_NAME : & str = "log" ;
155+
137156/// The rolegroup [`StatefulSet`] runs the rolegroup, as configured by the administrator.
138157///
139158/// The [`Pod`](`stackable_operator::k8s_openapi::api::core::v1::Pod`)s are accessible through the
@@ -325,13 +344,16 @@ pub(crate) async fn build_node_rolegroup_statefulset(
325344 . map ( NifiRepository :: volume_mount) ,
326345 )
327346 . context ( AddVolumeMountSnafu ) ?
328- . add_volume_mount ( "conf" , "/conf" )
347+ . add_volume_mount ( CONFIG_VOLUME_NAME , CONFIG_VOLUME_MOUNT )
329348 . context ( AddVolumeMountSnafu ) ?
330349 . add_volume_mount ( KEYSTORE_VOLUME_NAME , KEYSTORE_NIFI_CONTAINER_MOUNT )
331350 . context ( AddVolumeMountSnafu ) ?
332- . add_volume_mount ( "activeconf" , NIFI_CONFIG_DIRECTORY )
351+ . add_volume_mount ( ACTIVE_CONFIG_VOLUME_NAME , NIFI_CONFIG_DIRECTORY )
333352 . context ( AddVolumeMountSnafu ) ?
334- . add_volume_mount ( "sensitiveproperty" , "/stackable/sensitiveproperty" )
353+ . add_volume_mount (
354+ SENSITIVE_PROPERTY_VOLUME_NAME ,
355+ SENSITIVE_PROPERTY_VOLUME_MOUNT ,
356+ )
335357 . context ( AddVolumeMountSnafu ) ?
336358 . add_volume_mount ( LOG_VOLUME_NAME , STACKABLE_LOG_DIR )
337359 . context ( AddVolumeMountSnafu ) ?
@@ -392,9 +414,9 @@ pub(crate) async fn build_node_rolegroup_statefulset(
392414 . map ( NifiRepository :: volume_mount) ,
393415 )
394416 . context ( AddVolumeMountSnafu ) ?
395- . add_volume_mount ( "activeconf" , NIFI_CONFIG_DIRECTORY )
417+ . add_volume_mount ( ACTIVE_CONFIG_VOLUME_NAME , NIFI_CONFIG_DIRECTORY )
396418 . context ( AddVolumeMountSnafu ) ?
397- . add_volume_mount ( "log-config" , STACKABLE_LOG_CONFIG_DIR )
419+ . add_volume_mount ( LOG_CONFIG_VOLUME_NAME , STACKABLE_LOG_CONFIG_DIR )
398420 . context ( AddVolumeMountSnafu ) ?
399421 . add_volume_mount ( LOG_VOLUME_NAME , STACKABLE_LOG_DIR )
400422 . context ( AddVolumeMountSnafu ) ?
@@ -499,7 +521,7 @@ pub(crate) async fn build_node_rolegroup_statefulset(
499521 {
500522 pod_builder
501523 . add_volume ( Volume {
502- name : "log-config" . to_string ( ) ,
524+ name : LOG_CONFIG_VOLUME_NAME . to_string ( ) ,
503525 config_map : Some ( ConfigMapVolumeSource {
504526 name : config_map. clone ( ) ,
505527 ..ConfigMapVolumeSource :: default ( )
@@ -510,7 +532,7 @@ pub(crate) async fn build_node_rolegroup_statefulset(
510532 } else {
511533 pod_builder
512534 . add_volume ( Volume {
513- name : "log-config" . to_string ( ) ,
535+ name : LOG_CONFIG_VOLUME_NAME . to_string ( ) ,
514536 config_map : Some ( ConfigMapVolumeSource {
515537 name : resource_names. role_group_config_map ( ) . to_string ( ) ,
516538 ..ConfigMapVolumeSource :: default ( )
@@ -575,7 +597,7 @@ pub(crate) async fn build_node_rolegroup_statefulset(
575597 } )
576598 . context ( AddVolumeSnafu ) ?
577599 . add_volume ( Volume {
578- name : "conf" . to_string ( ) ,
600+ name : CONFIG_VOLUME_NAME . to_string ( ) ,
579601 config_map : Some ( ConfigMapVolumeSource {
580602 name : resource_names. role_group_config_map ( ) . to_string ( ) ,
581603 ..ConfigMapVolumeSource :: default ( )
@@ -625,7 +647,7 @@ pub(crate) async fn build_node_rolegroup_statefulset(
625647
626648 pod_builder
627649 . add_volume ( Volume {
628- name : "sensitiveproperty" . to_string ( ) ,
650+ name : SENSITIVE_PROPERTY_VOLUME_NAME . to_string ( ) ,
629651 secret : Some ( SecretVolumeSource {
630652 secret_name : Some ( sensitive_key_secret. to_string ( ) ) ,
631653 ..SecretVolumeSource :: default ( )
@@ -638,7 +660,7 @@ pub(crate) async fn build_node_rolegroup_statefulset(
638660 medium : None ,
639661 size_limit : None ,
640662 } ) ,
641- name : "activeconf" . to_string ( ) ,
663+ name : ACTIVE_CONFIG_VOLUME_NAME . to_string ( ) ,
642664 ..Volume :: default ( )
643665 } )
644666 . context ( AddVolumeSnafu ) ?
0 commit comments