@@ -82,6 +82,7 @@ fn broker_start_command(
8282 let client_port = kafka_security. client_port ( ) ;
8383
8484 // TODO: copy to tmp? mount readwrite folder?
85+ // TODO: do "cat /tmp/{properties_file}" ?
8586 if kafka. is_controller_configured ( ) {
8687 formatdoc ! { "
8788 export REPLICA_ID=$(echo \" $POD_NAME\" | grep -oE '[0-9]+$')
@@ -92,7 +93,7 @@ fn broker_start_command(
9293 echo \" {KAFKA_LISTENERS}={listeners}\" >> /tmp/{properties_file}
9394 echo \" {KAFKA_ADVERTISED_LISTENERS}={advertised_listeners}\" >> /tmp/{properties_file}
9495 echo \" {KAFKA_LISTENER_SECURITY_PROTOCOL_MAP}={listener_security_protocol_map}\" >> /tmp/{properties_file}
95- { controller_quorum_voters}
96+ echo \" {KAFKA_CONTROLLER_QUORUM_VOTERS}={ controller_quorum_voters} \" >> /tmp/{properties_file }
9697
9798 bin/kafka-storage.sh format --cluster-id {cluster_id} --config /tmp/{properties_file} --ignore-formatted {initial_controller_command}
9899 bin/kafka-server-start.sh /tmp/{properties_file} {opa_config}{jaas_config} &
@@ -103,11 +104,7 @@ fn broker_start_command(
103104 listeners = kafka_listeners. listeners( ) ,
104105 advertised_listeners = kafka_listeners. advertised_listeners( ) ,
105106 listener_security_protocol_map = kafka_listeners. listener_security_protocol_map( ) ,
106- controller_quorum_voters = controller_quorum_voters_command(
107- product_version,
108- BROKER_PROPERTIES_FILE ,
109- & to_quorum_voters( & controller_descriptors, client_port)
110- ) ,
107+ controller_quorum_voters = to_quorum_voters( & controller_descriptors, client_port) ,
111108 initial_controller_command = initial_controllers_command( & controller_descriptors, product_version, client_port) ,
112109 }
113110 } else {
@@ -152,8 +149,7 @@ pub fn controller_kafka_container_command(
152149 echo \" {KAFKA_CONTROLLER_QUORUM_BOOTSTRAP_SERVERS}={bootstrap_servers}\" >> /tmp/{properties_file}
153150 echo \" {KAFKA_LISTENERS}={listeners}\" >> /tmp/{properties_file}
154151 echo \" {KAFKA_LISTENER_SECURITY_PROTOCOL_MAP}={listener_security_protocol_map}\" >> /tmp/{properties_file}
155- {controller_quorum_voters}
156- cat /tmp/{properties_file}
152+ echo \" {KAFKA_CONTROLLER_QUORUM_VOTERS}={controller_quorum_voters}\" >> /tmp/{properties_file}
157153
158154 bin/kafka-storage.sh format --cluster-id {cluster_id} --config /tmp/{properties_file} --ignore-formatted {initial_controller_command}
159155 bin/kafka-server-start.sh /tmp/{properties_file} &
@@ -168,11 +164,7 @@ pub fn controller_kafka_container_command(
168164 listeners = to_listeners( client_port) ,
169165 listener_security_protocol_map = to_listener_security_protocol_map( kafka_listeners) ,
170166 initial_controller_command = initial_controllers_command( & controller_descriptors, product_version, client_port) ,
171- controller_quorum_voters = controller_quorum_voters_command(
172- product_version,
173- CONTROLLER_PROPERTIES_FILE ,
174- & to_quorum_voters( & controller_descriptors, client_port)
175- ) ,
167+ controller_quorum_voters = to_quorum_voters( & controller_descriptors, client_port) ,
176168 create_vector_shutdown_file_command = create_vector_shutdown_file_command( STACKABLE_LOG_DIR )
177169 }
178170}
@@ -232,16 +224,3 @@ fn initial_controllers_command(
232224 ) ,
233225 }
234226}
235-
236- fn controller_quorum_voters_command (
237- product_version : & str ,
238- properties_file : & str ,
239- quorum_voters : & str ,
240- ) -> String {
241- match product_version. starts_with ( "3.7" ) {
242- true => format ! (
243- "echo \" {KAFKA_CONTROLLER_QUORUM_VOTERS}={quorum_voters}\" >> /tmp/{properties_file}"
244- ) ,
245- false => "" . to_string ( ) ,
246- }
247- }
0 commit comments