@@ -91,7 +91,7 @@ use crate::{
9191 } ,
9292 listener:: {
9393 LISTENER_VOLUME_DIR , LISTENER_VOLUME_NAME , build_group_listener, build_group_listener_pvc,
94- group_listener_name,
94+ group_listener_name, secret_volume_listener_scope ,
9595 } ,
9696 operations:: {
9797 add_graceful_shutdown_config, graceful_shutdown_config_properties, pdb:: add_pdbs,
@@ -964,18 +964,15 @@ fn build_rolegroup_statefulset(
964964 . requested_secret_lifetime
965965 . context ( MissingSecretLifetimeSnafu ) ?;
966966
967- let extra_service_scopes = group_listener_name ( trino, trino_role)
968- . map ( |listener_service_name| vec ! [ listener_service_name] ) ;
969-
970967 // add volume mounts depending on the client tls, internal tls, catalogs and authentication
971968 tls_volume_mounts (
972969 trino,
970+ trino_role,
973971 & mut pod_builder,
974972 & mut cb_prepare,
975973 & mut cb_trino,
976974 catalogs,
977975 & requested_secret_lifetime,
978- extra_service_scopes,
979976 ) ?;
980977
981978 let mut prepare_args = vec ! [ ] ;
@@ -1515,20 +1512,17 @@ fn create_tls_volume(
15151512 volume_name : & str ,
15161513 tls_secret_class : & str ,
15171514 requested_secret_lifetime : & Duration ,
1518- service_scopes : Option < Vec < String > > ,
1515+ listener_scope : Option < String > ,
15191516) -> Result < Volume > {
15201517 let mut secret_volume_source_builder = SecretOperatorVolumeSourceBuilder :: new ( tls_secret_class) ;
15211518
15221519 secret_volume_source_builder
15231520 . with_pod_scope ( )
1524- . with_node_scope ( )
15251521 . with_format ( SecretFormat :: TlsPkcs12 )
15261522 . with_auto_tls_cert_lifetime ( * requested_secret_lifetime) ;
15271523
1528- if let Some ( scopes) = & service_scopes {
1529- for scope in scopes {
1530- secret_volume_source_builder. with_service_scope ( scope) ;
1531- }
1524+ if let Some ( listener_scope) = & listener_scope {
1525+ secret_volume_source_builder. with_listener_volume_scope ( listener_scope) ;
15321526 }
15331527
15341528 Ok ( VolumeBuilder :: new ( volume_name)
@@ -1542,12 +1536,12 @@ fn create_tls_volume(
15421536
15431537fn tls_volume_mounts (
15441538 trino : & v1alpha1:: TrinoCluster ,
1539+ trino_role : & TrinoRole ,
15451540 pod_builder : & mut PodBuilder ,
15461541 cb_prepare : & mut ContainerBuilder ,
15471542 cb_trino : & mut ContainerBuilder ,
15481543 catalogs : & [ CatalogConfig ] ,
15491544 requested_secret_lifetime : & Duration ,
1550- extra_service_scopes : Option < Vec < String > > ,
15511545) -> Result < ( ) > {
15521546 if let Some ( server_tls) = trino. get_server_tls ( ) {
15531547 cb_prepare
@@ -1562,7 +1556,7 @@ fn tls_volume_mounts(
15621556 server_tls,
15631557 requested_secret_lifetime,
15641558 // add listener
1565- extra_service_scopes ,
1559+ secret_volume_listener_scope ( trino_role ) ,
15661560 ) ?)
15671561 . context ( AddVolumeSnafu ) ?;
15681562 }
0 commit comments