@@ -754,9 +754,10 @@ mod tests {
754754 #[ test]
755755 fn vector_agent_adds_vector_container_to_statefulset ( ) {
756756 // Enabling the Vector agent wires a `vector` sidecar onto the StatefulSet, mounting the
757- // `config` (for `vector.yaml`) and `log` volumes. Its env vars come from the upstream
758- // `vector_container` helper, so this pins only the seam this operator owns: that the sidecar
759- // is added when the agent is enabled.
757+ // `config` (for `vector.yaml`) and `log` volumes. The env var format comes from the
758+ // upstream `vector_container` helper, but the identity values (cluster/role/role-group) and
759+ // the aggregator ConfigMap reference are wiring this operator supplies, so those are pinned
760+ // here (they were previously only checked by the kuttl smoke `14-assert` heredoc).
760761 let sts = build_sts (
761762 r#"
762763 apiVersion: zookeeper.stackable.tech/v1alpha1
@@ -807,6 +808,31 @@ mod tests {
807808 mount_names. contains( & LOG_VOLUME_NAME . as_ref( ) ) ,
808809 "vector container missing `log` volume mount: {mount_names:?}"
809810 ) ;
811+
812+ // Identity wiring this operator passes into the upstream `vector_container` helper.
813+ let env = vector. env . as_ref ( ) . expect ( "vector container env" ) ;
814+ let env_value = |name : & str | {
815+ env. iter ( )
816+ . find ( |e| e. name == name)
817+ . unwrap_or_else ( || panic ! ( "vector env {name} missing" ) )
818+ . value
819+ . as_deref ( )
820+ } ;
821+ assert_eq ! ( env_value( "CLUSTER_NAME" ) , Some ( "simple-zookeeper" ) ) ;
822+ assert_eq ! ( env_value( "ROLE_NAME" ) , Some ( "server" ) ) ;
823+ assert_eq ! ( env_value( "ROLE_GROUP_NAME" ) , Some ( "default" ) ) ;
824+
825+ // The aggregator address resolves from the discovery ConfigMap named in `clusterConfig`.
826+ let aggregator = env
827+ . iter ( )
828+ . find ( |e| e. name == "VECTOR_AGGREGATOR_ADDRESS" )
829+ . expect ( "VECTOR_AGGREGATOR_ADDRESS env var" )
830+ . value_from
831+ . as_ref ( )
832+ . and_then ( |source| source. config_map_key_ref . as_ref ( ) )
833+ . expect ( "VECTOR_AGGREGATOR_ADDRESS resolved from a ConfigMap key" ) ;
834+ assert_eq ! ( aggregator. name, "vector-aggregator-discovery" ) ;
835+ assert_eq ! ( aggregator. key, "ADDRESS" ) ;
810836 }
811837
812838 #[ test]
0 commit comments