From cc1bad832e158c1ecf53bcb77928d96207712d73 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 20 Dec 2024 11:19:25 +0100 Subject: [PATCH] refactor --- crates/stackable-operator/src/role_utils.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/crates/stackable-operator/src/role_utils.rs b/crates/stackable-operator/src/role_utils.rs index a50670e9..23a57f13 100644 --- a/crates/stackable-operator/src/role_utils.rs +++ b/crates/stackable-operator/src/role_utils.rs @@ -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 { + ) -> 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)) } }