@@ -1064,11 +1064,12 @@ async fn build_node_rolegroup_statefulset(
10641064 ) ;
10651065
10661066 let nifi_container_name = Container :: Nifi . to_string ( ) ;
1067- let mut container_builder = ContainerBuilder :: new ( & nifi_container_name) . with_context ( |_| {
1068- IllegalContainerNameSnafu {
1069- container_name : nifi_container_name,
1070- }
1071- } ) ?;
1067+ let mut container_nifi_builder =
1068+ ContainerBuilder :: new ( & nifi_container_name) . with_context ( |_| {
1069+ IllegalContainerNameSnafu {
1070+ container_name : nifi_container_name,
1071+ }
1072+ } ) ?;
10721073
10731074 let nifi_args = vec ! [ formatdoc! { "
10741075 {COMMON_BASH_TRAP_FUNCTIONS}
@@ -1084,7 +1085,7 @@ async fn build_node_rolegroup_statefulset(
10841085 create_vector_shutdown_file_command =
10851086 create_vector_shutdown_file_command( STACKABLE_LOG_DIR ) ,
10861087 } ] ;
1087- let container_nifi = container_builder
1088+ let container_nifi = container_nifi_builder
10881089 . image_from_product_image ( resolved_product_image)
10891090 . command ( vec ! [
10901091 "/bin/bash" . to_string( ) ,
@@ -1220,19 +1221,14 @@ async fn build_node_rolegroup_statefulset(
12201221 . add_volume_mount ( & volume_name, NIFI_PYTHON_WORKING_DIRECTORY )
12211222 . context ( AddVolumeMountSnafu ) ?;
12221223
1223- authentication_config
1224- . add_volumes_and_mounts (
1225- & mut pod_builder,
1226- vec ! [ & mut container_prepare, container_nifi] ,
1227- )
1228- . context ( AddAuthVolumesSnafu ) ?;
1229-
12301224 container_nifi
12311225 . add_volume_mounts ( git_sync_resources. git_content_volume_mounts . to_owned ( ) )
12321226 . context ( AddVolumeMountSnafu ) ?;
12331227
12341228 // We want to add nifi container first for easier defaulting into this container
1229+ // After calling `build()` the ContainerBuilder shouldn't be used anymore, so we drop it
12351230 pod_builder. add_container ( container_nifi. build ( ) ) ;
1231+ drop ( container_nifi_builder) ;
12361232
12371233 for container in git_sync_resources. git_sync_containers . iter ( ) . cloned ( ) {
12381234 pod_builder. add_container ( container) ;
@@ -1244,6 +1240,10 @@ async fn build_node_rolegroup_statefulset(
12441240 . add_volumes ( git_sync_resources. git_content_volumes . to_owned ( ) )
12451241 . context ( AddVolumeSnafu ) ?;
12461242
1243+ authentication_config
1244+ . add_volumes_and_mounts ( & mut pod_builder, vec ! [ & mut container_prepare] )
1245+ . context ( AddAuthVolumesSnafu ) ?;
1246+
12471247 if let Some ( ContainerLogConfig {
12481248 choice :
12491249 Some ( ContainerLogConfigChoice :: Custom ( CustomContainerLogConfig {
0 commit comments