@@ -98,8 +98,8 @@ impl<'a> KafkaTlsSecurity<'a> {
98
98
const INTER_SSL_CLIENT_AUTH : & ' static str = "listener.name.internal.ssl.client.auth" ;
99
99
// directories
100
100
// for kcat container
101
- const STACKABLE_TLS_CERT_SERVER_DIR : & ' static str = "/stackable/tls_cert_server_mount " ;
102
- const STACKABLE_TLS_CERT_SERVER_DIR_NAME : & ' static str = "tls-cert-server-mount " ;
101
+ const STACKABLE_TLS_CERT_KCAT_DIR : & ' static str = "/stackable/tls_cert_kcat " ;
102
+ const STACKABLE_TLS_CERT_KCAT_DIR_NAME : & ' static str = "tls-cert-kcat " ;
103
103
// kafka container
104
104
const STACKABLE_TLS_KEYSTORE_SERVER_DIR : & ' static str = "/stackable/tls_keystore_server" ;
105
105
const STACKABLE_TLS_KEYSTORE_SERVER_DIR_NAME : & ' static str = "tls-keystore-server" ;
@@ -218,12 +218,12 @@ impl<'a> KafkaTlsSecurity<'a> {
218
218
args. push ( "-b" . to_string ( ) ) ;
219
219
args. push ( format ! ( "localhost:{}" , port) ) ;
220
220
args. extend ( Self :: kcat_client_auth_ssl (
221
- Self :: STACKABLE_TLS_CERT_SERVER_DIR ,
221
+ Self :: STACKABLE_TLS_CERT_KCAT_DIR ,
222
222
) ) ;
223
223
} else if self . tls_server_secret_class ( ) . is_some ( ) {
224
224
args. push ( "-b" . to_string ( ) ) ;
225
225
args. push ( format ! ( "localhost:{}" , port) ) ;
226
- args. extend ( Self :: kcat_client_ssl ( Self :: STACKABLE_TLS_CERT_SERVER_DIR ) ) ;
226
+ args. extend ( Self :: kcat_client_ssl ( Self :: STACKABLE_TLS_CERT_KCAT_DIR ) ) ;
227
227
} else {
228
228
args. push ( "-b" . to_string ( ) ) ;
229
229
args. push ( format ! ( "localhost:{}" , port) ) ;
@@ -272,14 +272,13 @@ impl<'a> KafkaTlsSecurity<'a> {
272
272
// add tls (server or client authentication volumes) if required
273
273
if let Some ( tls_server_secret_class) = self . get_tls_secret_class ( ) {
274
274
// We have to mount tls pem files for kcat (the mount can be used directly)
275
- pod_builder. add_volume ( Self :: create_tls_volume (
276
- & self . kafka . bootstrap_service_name ( ) ,
277
- Self :: STACKABLE_TLS_CERT_SERVER_DIR_NAME ,
275
+ pod_builder. add_volume ( Self :: create_kcat_tls_volume (
276
+ Self :: STACKABLE_TLS_CERT_KCAT_DIR_NAME ,
278
277
tls_server_secret_class,
279
278
) ?) ;
280
279
cb_kcat_prober. add_volume_mount (
281
- Self :: STACKABLE_TLS_CERT_SERVER_DIR_NAME ,
282
- Self :: STACKABLE_TLS_CERT_SERVER_DIR ,
280
+ Self :: STACKABLE_TLS_CERT_KCAT_DIR_NAME ,
281
+ Self :: STACKABLE_TLS_CERT_KCAT_DIR ,
283
282
) ;
284
283
// Keystores fore the kafka container
285
284
pod_builder. add_volume ( Self :: create_tls_keystore_volume (
@@ -426,18 +425,13 @@ impl<'a> KafkaTlsSecurity<'a> {
426
425
. or ( self . server_secret_class . as_ref ( ) )
427
426
}
428
427
429
- /// Creates ephemeral volumes to mount the `SecretClass` into the Pods
430
- fn create_tls_volume (
431
- kafka_bootstrap_service_name : & str ,
432
- volume_name : & str ,
433
- secret_class_name : & str ,
434
- ) -> Result < Volume , Error > {
428
+ /// Creates ephemeral volumes to mount the `SecretClass` into the Pods for kcat client
429
+ fn create_kcat_tls_volume ( volume_name : & str , secret_class_name : & str ) -> Result < Volume , Error > {
435
430
Ok ( VolumeBuilder :: new ( volume_name)
436
431
. ephemeral (
437
432
SecretOperatorVolumeSourceBuilder :: new ( secret_class_name)
438
433
. with_pod_scope ( )
439
- . with_node_scope ( )
440
- . with_service_scope ( kafka_bootstrap_service_name)
434
+ . with_format ( SecretFormat :: TlsPem )
441
435
. build ( )
442
436
. context ( SecretVolumeBuildSnafu ) ?,
443
437
)
0 commit comments