Skip to content

Commit 3dc6bd3

Browse files
committed
use already-resolved hbase role
1 parent c1326c2 commit 3dc6bd3

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

rust/operator-binary/src/hbase_controller.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
use std::{
44
collections::{BTreeMap, HashMap},
55
fmt::Write,
6-
str::FromStr,
76
sync::Arc,
87
};
98

@@ -366,6 +365,7 @@ pub async fn reconcile_hbase(
366365

367366
let rg_configmap = build_rolegroup_config_map(
368367
hbase,
368+
hbase_role,
369369
&client.kubernetes_cluster_info,
370370
&rolegroup,
371371
&validated_rg_config.product_config_properties,
@@ -465,6 +465,7 @@ pub async fn reconcile_hbase(
465465
#[allow(clippy::too_many_arguments)]
466466
fn build_rolegroup_config_map(
467467
hbase: &v1alpha1::HbaseCluster,
468+
hbase_role: &HbaseRole,
468469
cluster_info: &KubernetesClusterInfo,
469470
rolegroup: &RoleGroupRef<v1alpha1::HbaseCluster>,
470471
rolegroup_config: &HashMap<PropertyNameKind, BTreeMap<String, String>>,
@@ -478,11 +479,6 @@ fn build_rolegroup_config_map(
478479
let mut ssl_server_xml = String::new();
479480
let mut ssl_client_xml = String::new();
480481

481-
let hbase_role =
482-
HbaseRole::from_str(rolegroup.role.as_ref()).with_context(|_| UnknownHbaseRoleSnafu {
483-
role: rolegroup.role.clone(),
484-
})?;
485-
486482
for (property_name_kind, config) in rolegroup_config {
487483
match property_name_kind {
488484
PropertyNameKind::File(file_name) if file_name == HBASE_SITE_XML => {
@@ -579,7 +575,7 @@ fn build_rolegroup_config_map(
579575
}
580576
PropertyNameKind::File(file_name) if file_name == HBASE_ENV_SH => {
581577
let mut hbase_env_config =
582-
build_hbase_env_sh(hbase, merged_config, &hbase_role, &rolegroup.role_group)?;
578+
build_hbase_env_sh(hbase, merged_config, hbase_role, &rolegroup.role_group)?;
583579

584580
// configOverride come last
585581
hbase_env_config.extend(config.clone());

0 commit comments

Comments
 (0)