Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernauer committed Dec 20, 2024
1 parent 5ee9d11 commit cc1bad8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions crates/stackable-operator/src/role_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,21 +368,22 @@ where
}
}

pub fn merged_product_specific_common_config(
/// Returns the product specific common config from
/// 1. The role
/// 2. The role group
pub fn merged_product_specific_common_configs(
&self,
role_group: &str,
) -> Result<ProductSpecificCommonConfig, Error> {
) -> Result<(&ProductSpecificCommonConfig, &ProductSpecificCommonConfig), Error> {
let from_role = &self.config.product_specific_common_config;
let mut merged = self
let from_role_group = &self
.role_groups
.get(role_group)
.with_context(|| MissingRoleGroupSnafu { role_group })?
.config
.product_specific_common_config
.clone();
merged.merge(from_role);
.product_specific_common_config;

Ok(merged)
Ok((from_role, from_role_group))
}
}

Expand Down

0 comments on commit cc1bad8

Please sign in to comment.