@@ -88,7 +88,7 @@ use crate::{
8888 v1alpha1,
8989 } ,
9090 operations:: { graceful_shutdown:: add_graceful_shutdown_config, pdb:: add_pdbs} ,
91- product_logging:: { extend_role_group_config_map, resolve_vector_aggregator_address } ,
91+ product_logging:: extend_role_group_config_map,
9292 reporting_task:: { self , build_maybe_reporting_task, build_reporting_task_service_name} ,
9393 security:: {
9494 authentication:: {
@@ -254,10 +254,8 @@ pub enum Error {
254254 #[ snafu( display( "failed to resolve and merge config for role and role group" ) ) ]
255255 FailedToResolveConfig { source : crate :: crd:: Error } ,
256256
257- #[ snafu( display( "failed to resolve the Vector aggregator address" ) ) ]
258- ResolveVectorAggregatorAddress {
259- source : crate :: product_logging:: Error ,
260- } ,
257+ #[ snafu( display( "vector agent is enabled but vector aggregator ConfigMap is missing" ) ) ]
258+ VectorAggregatorConfigMapMissing ,
261259
262260 #[ snafu( display( "failed to add the logging configuration to the ConfigMap [{cm_name}]" ) ) ]
263261 InvalidLoggingConfig {
@@ -515,10 +513,6 @@ pub async fn reconcile_nifi(
515513 . context ( SecuritySnafu ) ?;
516514 }
517515
518- let vector_aggregator_address = resolve_vector_aggregator_address ( nifi, client)
519- . await
520- . context ( ResolveVectorAggregatorAddressSnafu ) ?;
521-
522516 let ( rbac_sa, rbac_rolebinding) = build_rbac_resources (
523517 nifi,
524518 APP_NAME ,
@@ -572,7 +566,6 @@ pub async fn reconcile_nifi(
572566 & rolegroup,
573567 rolegroup_config,
574568 & merged_config,
575- vector_aggregator_address. as_deref ( ) ,
576569 & proxy_hosts,
577570 )
578571 . await ?;
@@ -747,7 +740,6 @@ async fn build_node_rolegroup_config_map(
747740 rolegroup : & RoleGroupRef < v1alpha1:: NifiCluster > ,
748741 rolegroup_config : & HashMap < PropertyNameKind , BTreeMap < String , String > > ,
749742 merged_config : & NifiConfig ,
750- vector_aggregator_address : Option < & str > ,
751743 proxy_hosts : & str ,
752744) -> Result < ConfigMap > {
753745 tracing:: debug!( "building rolegroup configmaps" ) ;
@@ -833,15 +825,11 @@ async fn build_node_rolegroup_config_map(
833825 } ) ?,
834826 ) ;
835827
836- extend_role_group_config_map (
837- rolegroup,
838- vector_aggregator_address,
839- & merged_config. logging ,
840- & mut cm_builder,
841- )
842- . context ( InvalidLoggingConfigSnafu {
843- cm_name : rolegroup. object_name ( ) ,
844- } ) ?;
828+ extend_role_group_config_map ( rolegroup, & merged_config. logging , & mut cm_builder) . context (
829+ InvalidLoggingConfigSnafu {
830+ cm_name : rolegroup. object_name ( ) ,
831+ } ,
832+ ) ?;
845833
846834 cm_builder
847835 . build ( )
@@ -1244,21 +1232,29 @@ async fn build_node_rolegroup_statefulset(
12441232 }
12451233
12461234 if merged_config. logging . enable_vector_agent {
1247- pod_builder. add_container (
1248- product_logging:: framework:: vector_container (
1249- resolved_product_image,
1250- "config" ,
1251- "log" ,
1252- merged_config. logging . containers . get ( & Container :: Vector ) ,
1253- ResourceRequirementsBuilder :: new ( )
1254- . with_cpu_request ( "250m" )
1255- . with_cpu_limit ( "500m" )
1256- . with_memory_request ( "128Mi" )
1257- . with_memory_limit ( "128Mi" )
1258- . build ( ) ,
1259- )
1260- . context ( ConfigureLoggingSnafu ) ?,
1261- ) ;
1235+ match & nifi. spec . cluster_config . vector_aggregator_config_map_name {
1236+ Some ( vector_aggregator_config_map_name) => {
1237+ pod_builder. add_container (
1238+ product_logging:: framework:: vector_container (
1239+ resolved_product_image,
1240+ "config" ,
1241+ "log" ,
1242+ merged_config. logging . containers . get ( & Container :: Vector ) ,
1243+ ResourceRequirementsBuilder :: new ( )
1244+ . with_cpu_request ( "250m" )
1245+ . with_cpu_limit ( "500m" )
1246+ . with_memory_request ( "128Mi" )
1247+ . with_memory_limit ( "128Mi" )
1248+ . build ( ) ,
1249+ vector_aggregator_config_map_name,
1250+ )
1251+ . context ( ConfigureLoggingSnafu ) ?,
1252+ ) ;
1253+ }
1254+ None => {
1255+ VectorAggregatorConfigMapMissingSnafu . fail ( ) ?;
1256+ }
1257+ }
12621258 }
12631259
12641260 nifi_auth_config
0 commit comments