@@ -8,6 +8,7 @@ use std::{
8
8
} ;
9
9
10
10
use const_format:: concatcp;
11
+ use indoc:: formatdoc;
11
12
use product_config:: {
12
13
types:: PropertyNameKind ,
13
14
writer:: { to_hadoop_xml, to_java_properties_string, PropertiesWriterError } ,
@@ -861,14 +862,24 @@ fn build_rolegroup_statefulset(
861
862
} ,
862
863
] ) ;
863
864
865
+ let role_name = hbase_role. cli_role_name ( ) ;
864
866
let mut hbase_container = ContainerBuilder :: new ( "hbase" ) . expect ( "ContainerBuilder not created" ) ;
865
867
hbase_container
866
868
. image_from_product_image ( resolved_product_image)
867
- . command ( vec ! [ "/stackable/hbase/bin/hbase-entrypoint.sh" . to_string( ) ] )
868
- . args ( vec ! [
869
- hbase_role. cli_role_name( ) ,
870
- hbase_service_domain_name( hbase, rolegroup_ref, cluster_info) ?,
871
- hbase. service_port( hbase_role) . to_string( ) ,
869
+ . command ( command ( ) )
870
+ . args ( vec ! [ formatdoc!{ "
871
+ {export_address}
872
+ {export_port}
873
+ {export_hostname}
874
+ {entrypoint} {role} {domain} {port}" ,
875
+ export_address = format!( "export HBASE_CONF_hbase_{role_name}_hostname=$(cat /stackable/listener/default-address/address);" ) . to_string( ) ,
876
+ export_port = format!( "export HBASE_CONF_hbase_{role_name}_port=$(cat /stackable/listener/default-address/ports/ui-http);" ) . to_string( ) ,
877
+ export_hostname = "export HOSTNAME=$(cat /stackable/listener/default-address/address);" . to_string( ) ,
878
+ entrypoint = "/stackable/hbase/bin/hbase-entrypoint.sh" . to_string( ) ,
879
+ role = role_name,
880
+ domain = hbase_service_domain_name( hbase, rolegroup_ref, cluster_info) ?,
881
+ port = hbase. service_port( hbase_role) . to_string( ) ,
882
+ }
872
883
] )
873
884
. add_env_vars ( merged_env)
874
885
// Needed for the `containerdebug` process to log it's tracing information to.
@@ -1059,6 +1070,17 @@ fn build_rolegroup_statefulset(
1059
1070
} )
1060
1071
}
1061
1072
1073
+ /// Returns the container command.
1074
+ fn command ( ) -> Vec < String > {
1075
+ vec ! [
1076
+ "/bin/bash" . to_string( ) ,
1077
+ "-x" . to_string( ) ,
1078
+ "-euo" . to_string( ) ,
1079
+ "pipefail" . to_string( ) ,
1080
+ "-c" . to_string( ) ,
1081
+ ]
1082
+ }
1083
+
1062
1084
fn write_hbase_env_sh < ' a , T > ( properties : T ) -> String
1063
1085
where
1064
1086
T : Iterator < Item = ( & ' a String , & ' a String ) > ,
0 commit comments