@@ -11,21 +11,20 @@ use stackable_operator::{
1111} ;
1212
1313use crate :: {
14- controller:: { RoleGroupName , ValidatedCluster } ,
14+ controller:: { RoleGroupName , ValidatedCluster , security :: ValidatedKafkaSecurity } ,
1515 crd:: {
1616 STACKABLE_LISTENER_BROKER_DIR ,
1717 listener:: {
1818 KafkaListener , KafkaListenerConfig , KafkaListenerName , KafkaListenerProtocol ,
1919 LISTENER_LOCAL_ADDRESS , node_address_cmd, node_port_cmd,
2020 } ,
2121 role:: KafkaRole ,
22- security:: KafkaTlsSecurity ,
2322 } ,
2423} ;
2524
2625pub fn get_kafka_listener_config (
2726 validated_cluster : & ValidatedCluster ,
28- kafka_security : & KafkaTlsSecurity ,
27+ kafka_security : & ValidatedKafkaSecurity ,
2928 role : & KafkaRole ,
3029 role_group_name : & RoleGroupName ,
3130 cluster_info : & KubernetesClusterInfo ,
@@ -49,7 +48,7 @@ pub fn get_kafka_listener_config(
4948 listeners. push ( KafkaListener {
5049 name : KafkaListenerName :: Client ,
5150 host : LISTENER_LOCAL_ADDRESS . to_string ( ) ,
52- port : KafkaTlsSecurity :: SECURE_CLIENT_PORT . to_string ( ) ,
51+ port : ValidatedKafkaSecurity :: SECURE_CLIENT_PORT . to_string ( ) ,
5352 } ) ;
5453 advertised_listeners. push ( KafkaListener {
5554 name : KafkaListenerName :: Client ,
@@ -85,7 +84,7 @@ pub fn get_kafka_listener_config(
8584 listeners. push ( KafkaListener {
8685 name : KafkaListenerName :: Client ,
8786 host : LISTENER_LOCAL_ADDRESS . to_string ( ) ,
88- port : KafkaTlsSecurity :: CLIENT_PORT . to_string ( ) ,
87+ port : ValidatedKafkaSecurity :: CLIENT_PORT . to_string ( ) ,
8988 } ) ;
9089 advertised_listeners. push ( KafkaListener {
9190 name : KafkaListenerName :: Client ,
@@ -106,12 +105,12 @@ pub fn get_kafka_listener_config(
106105 listeners. push ( KafkaListener {
107106 name : KafkaListenerName :: Internal ,
108107 host : LISTENER_LOCAL_ADDRESS . to_string ( ) ,
109- port : KafkaTlsSecurity :: SECURE_INTERNAL_PORT . to_string ( ) ,
108+ port : ValidatedKafkaSecurity :: SECURE_INTERNAL_PORT . to_string ( ) ,
110109 } ) ;
111110 advertised_listeners. push ( KafkaListener {
112111 name : KafkaListenerName :: Internal ,
113112 host : pod_fqdn. to_string ( ) ,
114- port : KafkaTlsSecurity :: SECURE_INTERNAL_PORT . to_string ( ) ,
113+ port : ValidatedKafkaSecurity :: SECURE_INTERNAL_PORT . to_string ( ) ,
115114 } ) ;
116115 listener_security_protocol_map
117116 . insert ( KafkaListenerName :: Internal , KafkaListenerProtocol :: Ssl ) ;
@@ -220,7 +219,7 @@ mod tests {
220219 "# ;
221220 let kafka = minimal_kafka ( kafka_cluster) ;
222221 let validated = validated_cluster ( & kafka) ;
223- let kafka_security = KafkaTlsSecurity :: new (
222+ let kafka_security = ValidatedKafkaSecurity :: new (
224223 ResolvedAuthenticationClasses :: new ( vec ! [ core:: v1alpha1:: AuthenticationClass {
225224 metadata: ObjectMetaBuilder :: new( ) . name( "auth-class" ) . build( ) ,
226225 spec: core:: v1alpha1:: AuthenticationClassSpec {
@@ -294,7 +293,7 @@ mod tests {
294293 )
295294 ) ;
296295
297- let kafka_security = KafkaTlsSecurity :: new (
296+ let kafka_security = ValidatedKafkaSecurity :: new (
298297 ResolvedAuthenticationClasses :: new ( vec ! [ ] ) ,
299298 Some ( "tls" . parse ( ) . unwrap ( ) ) ,
300299 Some ( "tls" . parse ( ) . unwrap ( ) ) ,
@@ -357,8 +356,12 @@ mod tests {
357356 )
358357 ) ;
359358
360- let kafka_security =
361- KafkaTlsSecurity :: new ( ResolvedAuthenticationClasses :: new ( vec ! [ ] ) , None , None , None ) ;
359+ let kafka_security = ValidatedKafkaSecurity :: new (
360+ ResolvedAuthenticationClasses :: new ( vec ! [ ] ) ,
361+ None ,
362+ None ,
363+ None ,
364+ ) ;
362365
363366 let config = get_kafka_listener_config (
364367 & validated,
@@ -441,7 +444,7 @@ mod tests {
441444 "# ;
442445 let kafka = minimal_kafka ( kafka_cluster) ;
443446 let validated = validated_cluster ( & kafka) ;
444- let kafka_security = KafkaTlsSecurity :: new (
447+ let kafka_security = ValidatedKafkaSecurity :: new (
445448 ResolvedAuthenticationClasses :: new ( vec ! [ core:: v1alpha1:: AuthenticationClass {
446449 metadata: ObjectMetaBuilder :: new( ) . name( "auth-class" ) . build( ) ,
447450 spec: core:: v1alpha1:: AuthenticationClassSpec {
0 commit comments