Skip to content

Commit 6f188de

Browse files
committed
fix: drop vector_config from build_config_map
1 parent 6780f7f commit 6f188de

2 files changed

Lines changed: 9 additions & 17 deletions

File tree

rust/operator-binary/src/controller/build/resource/config_map.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use stackable_operator::{
99

1010
use crate::controller::{
1111
OpaRoleGroupConfig, RoleGroupName, ValidatedCluster,
12-
build::properties::{ConfigFileName, config_json, user_info_fetcher},
12+
build::properties::{ConfigFileName, config_json, product_logging, user_info_fetcher},
1313
};
1414

1515
#[derive(Snafu, Debug)]
@@ -32,13 +32,12 @@ type Result<T, E = Error> = std::result::Result<T, E>;
3232
/// The rolegroup [`ConfigMap`] configures the rolegroup based on the configuration given by the
3333
/// administrator.
3434
///
35-
/// `vector_config` is the Vector agent config (`vector.yaml`) built by the caller; it is `None`
36-
/// when the Vector agent is disabled.
35+
/// The Vector agent config (`vector.yaml`) is added only when the Vector agent is enabled for this
36+
/// role group.
3737
pub fn build_rolegroup_config_map(
3838
cluster: &ValidatedCluster,
3939
role_group_name: &RoleGroupName,
4040
rolegroup_config: &OpaRoleGroupConfig,
41-
vector_config: Option<String>,
4241
) -> Result<ConfigMap> {
4342
let mut cm_builder = ConfigMapBuilder::new();
4443

@@ -65,8 +64,11 @@ pub fn build_rolegroup_config_map(
6564
);
6665
}
6766

68-
if let Some(vector_config) = vector_config {
69-
cm_builder.add_data(VECTOR_CONFIG_FILE, vector_config);
67+
if rolegroup_config.config.logging.vector_container.is_some() {
68+
cm_builder.add_data(
69+
VECTOR_CONFIG_FILE,
70+
product_logging::vector_config_file_content(),
71+
);
7072
}
7173

7274
cm_builder.build().with_context(|_| AssembleSnafu {
@@ -93,7 +95,7 @@ mod tests {
9395
.next()
9496
.expect("the default role group should exist");
9597

96-
build_rolegroup_config_map(&validated, role_group_name, rg, None)
98+
build_rolegroup_config_map(&validated, role_group_name, rg)
9799
.expect("the config map should build")
98100
}
99101

rust/operator-binary/src/opa_controller.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -211,20 +211,10 @@ pub async fn reconcile_opa(
211211
let mut ds_cond_builder = DaemonSetConditionBuilder::default();
212212

213213
for (rolegroup_name, rolegroup) in role_group_configs {
214-
// The static Vector agent config (`vector.yaml`) is added to the rolegroup ConfigMap only
215-
// when the Vector agent is enabled for this role group.
216-
let vector_config = rolegroup
217-
.config
218-
.logging
219-
.vector_container
220-
.as_ref()
221-
.map(|_| build::properties::product_logging::vector_config_file_content());
222-
223214
let rg_configmap = build::resource::config_map::build_rolegroup_config_map(
224215
&validated_cluster,
225216
rolegroup_name,
226217
rolegroup,
227-
vector_config,
228218
)
229219
.with_context(|_| BuildRoleGroupConfigSnafu {
230220
rolegroup: rolegroup_name.clone(),

0 commit comments

Comments
 (0)