@@ -67,10 +67,10 @@ use strum::{EnumDiscriminants, IntoStaticStr, ParseError};
6767
6868use stackable_hbase_crd:: {
6969 merged_env, Container , HbaseCluster , HbaseClusterStatus , HbaseConfig , HbaseConfigFragment ,
70- HbaseRole , APP_NAME , CONFIG_DIR_NAME , DEFAULT_SECRET_LIFETIME , HBASE_ENV_SH , HBASE_HEAPSIZE ,
71- HBASE_MANAGES_ZK , HBASE_MASTER_OPTS , HBASE_REGIONSERVER_OPTS , HBASE_REST_OPTS ,
72- HBASE_REST_PORT_NAME_HTTP , HBASE_REST_PORT_NAME_HTTPS , HBASE_SITE_XML , JVM_HEAP_FACTOR ,
73- JVM_SECURITY_PROPERTIES_FILE , METRICS_PORT , SSL_CLIENT_XML , SSL_SERVER_XML ,
70+ HbaseRole , APP_NAME , CONFIG_DIR_NAME , HBASE_ENV_SH , HBASE_HEAPSIZE , HBASE_MANAGES_ZK ,
71+ HBASE_MASTER_OPTS , HBASE_REGIONSERVER_OPTS , HBASE_REST_OPTS , HBASE_REST_PORT_NAME_HTTP ,
72+ HBASE_REST_PORT_NAME_HTTPS , HBASE_SITE_XML , JVM_HEAP_FACTOR , JVM_SECURITY_PROPERTIES_FILE ,
73+ METRICS_PORT , SSL_CLIENT_XML , SSL_SERVER_XML ,
7474} ;
7575
7676use crate :: product_logging:: STACKABLE_LOG_DIR ;
@@ -113,6 +113,9 @@ pub struct Ctx {
113113#[ strum_discriminants( derive( IntoStaticStr ) ) ]
114114#[ allow( clippy:: enum_variant_names) ]
115115pub enum Error {
116+ #[ snafu( display( "missing secret lifetime" ) ) ]
117+ MissingSecretLifetime ,
118+
116119 #[ snafu( display( "object defines no version" ) ) ]
117120 ObjectHasNoVersion ,
118121
@@ -777,7 +780,7 @@ fn build_rolegroup_statefulset(
777780 hbase_role : & HbaseRole ,
778781 rolegroup_ref : & RoleGroupRef < HbaseCluster > ,
779782 rolegroup_config : & HashMap < PropertyNameKind , BTreeMap < String , String > > ,
780- config : & HbaseConfig ,
783+ merged_config : & HbaseConfig ,
781784 resolved_product_image : & ResolvedProductImage ,
782785 service_account : & ServiceAccount ,
783786) -> Result < StatefulSet > {
@@ -899,7 +902,7 @@ fn build_rolegroup_statefulset(
899902 . add_volume_mount ( "log" , STACKABLE_LOG_DIR )
900903 . context ( AddVolumeMountSnafu ) ?
901904 . add_container_ports ( ports)
902- . resources ( config . resources . clone ( ) . into ( ) )
905+ . resources ( merged_config . resources . clone ( ) . into ( ) )
903906 . startup_probe ( startup_probe)
904907 . liveness_probe ( liveness_probe)
905908 . readiness_probe ( readiness_probe) ;
@@ -919,7 +922,7 @@ fn build_rolegroup_statefulset(
919922 pod_builder
920923 . metadata ( pb_metadata)
921924 . image_pull_secrets_from_product_image ( resolved_product_image)
922- . affinity ( & config . affinity )
925+ . affinity ( & merged_config . affinity )
923926 . add_volume ( stackable_operator:: k8s_openapi:: api:: core:: v1:: Volume {
924927 name : "hbase-config" . to_string ( ) ,
925928 config_map : Some ( ConfigMapVolumeSource {
@@ -959,7 +962,7 @@ fn build_rolegroup_statefulset(
959962 Some ( ContainerLogConfigChoice :: Custom ( CustomContainerLogConfig {
960963 custom : ConfigMapLogConfig { config_map } ,
961964 } ) ) ,
962- } ) = config . logging . containers . get ( & Container :: Hbase )
965+ } ) = merged_config . logging . containers . get ( & Container :: Hbase )
963966 {
964967 pod_builder
965968 . add_volume ( Volume {
@@ -984,29 +987,29 @@ fn build_rolegroup_statefulset(
984987 . context ( AddVolumeSnafu ) ?;
985988 }
986989
987- add_graceful_shutdown_config ( config , & mut pod_builder) . context ( GracefulShutdownSnafu ) ?;
990+ add_graceful_shutdown_config ( merged_config , & mut pod_builder) . context ( GracefulShutdownSnafu ) ?;
988991 if hbase. has_kerberos_enabled ( ) {
989992 add_kerberos_pod_config (
990993 hbase,
991994 hbase_role,
992995 & mut hbase_container,
993996 & mut pod_builder,
994- config
997+ merged_config
995998 . requested_secret_lifetime
996- . unwrap_or ( DEFAULT_SECRET_LIFETIME ) ,
999+ . context ( MissingSecretLifetimeSnafu ) ? ,
9971000 )
9981001 . context ( AddKerberosConfigSnafu ) ?;
9991002 }
10001003 pod_builder. add_container ( hbase_container. build ( ) ) ;
10011004
10021005 // Vector sidecar shall be the last container in the list
1003- if config . logging . enable_vector_agent {
1006+ if merged_config . logging . enable_vector_agent {
10041007 pod_builder. add_container (
10051008 product_logging:: framework:: vector_container (
10061009 resolved_product_image,
10071010 "hbase-config" ,
10081011 "log" ,
1009- config . logging . containers . get ( & Container :: Vector ) ,
1012+ merged_config . logging . containers . get ( & Container :: Vector ) ,
10101013 ResourceRequirementsBuilder :: new ( )
10111014 . with_cpu_request ( "250m" )
10121015 . with_cpu_limit ( "500m" )
0 commit comments