@@ -92,7 +92,7 @@ use crate::{
9292 APP_NAME , CORE_SITE_XML , Container , DB_PASSWORD_ENV , DB_USERNAME_ENV , HIVE_PORT ,
9393 HIVE_PORT_NAME , HIVE_SITE_XML , HiveClusterStatus , HiveRole , JVM_SECURITY_PROPERTIES_FILE ,
9494 LISTENER_VOLUME_DIR , LISTENER_VOLUME_NAME , METRICS_PORT , METRICS_PORT_NAME ,
95- MetaStoreConfig , MetaStoreConfigFragment , STACKABLE_CONFIG_DIR , STACKABLE_CONFIG_DIR_NAME ,
95+ MetaStoreConfig , STACKABLE_CONFIG_DIR , STACKABLE_CONFIG_DIR_NAME ,
9696 STACKABLE_CONFIG_MOUNT_DIR , STACKABLE_CONFIG_MOUNT_DIR_NAME ,
9797 STACKABLE_LOG_CONFIG_MOUNT_DIR , STACKABLE_LOG_CONFIG_MOUNT_DIR_NAME , STACKABLE_LOG_DIR ,
9898 STACKABLE_LOG_DIR_NAME ,
@@ -501,52 +501,52 @@ pub async fn reconcile_hive(
501501 } ) ?,
502502 ) ;
503503 }
504- // Init listener struct. Collect listener after applied to cluster_resources
505- // to use listener object in later created discovery configMap
506- let mut listener = Listener :: new ( "name" , ListenerSpec :: default ( ) ) ;
504+
507505 let role_config = hive. role_config ( & hive_role) ;
508506 if let Some ( HiveMetastoreRoleConfig {
509507 common : GenericRoleConfig {
510508 pod_disruption_budget : pdb,
511509 } ,
512- listener_class ,
510+ ..
513511 } ) = role_config
514512 {
515513 add_pdbs ( pdb, hive, & hive_role, client, & mut cluster_resources)
516514 . await
517515 . context ( FailedToCreatePdbSnafu ) ?;
516+ }
517+
518+ // std's SipHasher is deprecated, and DefaultHasher is unstable across Rust releases.
519+ // We don't /need/ stability, but it's still nice to avoid spurious changes where possible.
520+ let mut discovery_hash = FnvHasher :: with_key ( 0 ) ;
518521
522+ if let Some ( HiveMetastoreRoleConfig { listener_class, .. } ) = role_config {
519523 let group_listener: Listener =
520524 build_group_listener ( hive, & resolved_product_image, & hive_role, listener_class) ?;
521- listener = cluster_resources
525+ let listener = cluster_resources
522526 . add ( client, group_listener)
523527 . await
524- . with_context ( |_| ApplyGroupListenerSnafu {
528+ . context ( ApplyGroupListenerSnafu {
525529 role : hive_role. to_string ( ) ,
526530 } ) ?;
527- }
528-
529- // std's SipHasher is deprecated, and DefaultHasher is unstable across Rust releases.
530- // We don't /need/ stability, but it's still nice to avoid spurious changes where possible.
531- let mut discovery_hash = FnvHasher :: with_key ( 0 ) ;
532531
533- for discovery_cm in discovery:: build_discovery_configmaps (
534- hive,
535- hive,
536- hive_role,
537- & resolved_product_image,
538- None ,
539- listener,
540- )
541- . await
542- . context ( BuildDiscoveryConfigSnafu ) ?
543- {
544- let discovery_cm = cluster_resources
545- . add ( client, discovery_cm)
546- . await
547- . context ( ApplyDiscoveryConfigSnafu ) ?;
548- if let Some ( generation) = discovery_cm. metadata . resource_version {
549- discovery_hash. write ( generation. as_bytes ( ) )
532+ for discovery_cm in discovery:: build_discovery_configmaps (
533+ hive,
534+ hive,
535+ hive_role,
536+ & resolved_product_image,
537+ None ,
538+ listener,
539+ )
540+ . await
541+ . context ( BuildDiscoveryConfigSnafu ) ?
542+ {
543+ let discovery_cm = cluster_resources
544+ . add ( client, discovery_cm)
545+ . await
546+ . context ( ApplyDiscoveryConfigSnafu ) ?;
547+ if let Some ( generation) = discovery_cm. metadata . resource_version {
548+ discovery_hash. write ( generation. as_bytes ( ) )
549+ }
550550 }
551551 }
552552
0 commit comments