Skip to content

Commit 5830389

Browse files
committed
rearange config map properties
1 parent 0a814d8 commit 5830389

2 files changed

Lines changed: 12 additions & 49 deletions

File tree

rust/operator-binary/src/crd/role/broker.rs

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ use stackable_operator::{
1515
use strum::{Display, EnumIter};
1616

1717
use crate::crd::{
18-
listener::KafkaListenerName,
19-
role::{
20-
KAFKA_LOG_DIRS, KAFKA_PROCESS_ROLES, KafkaRole,
21-
commons::{CommonConfig, Storage, StorageFragment},
22-
},
18+
role::commons::{CommonConfig, Storage, StorageFragment},
2319
v1alpha1,
2420
};
2521

@@ -129,44 +125,11 @@ impl Configuration for BrokerConfigFragment {
129125

130126
fn compute_files(
131127
&self,
132-
resource: &Self::Configurable,
128+
_resource: &Self::Configurable,
133129
_role_name: &str,
134-
file: &str,
130+
_file: &str,
135131
) -> Result<BTreeMap<String, Option<String>>, stackable_operator::product_config_utils::Error>
136132
{
137-
let mut config = BTreeMap::new();
138-
139-
if file == BROKER_PROPERTIES_FILE {
140-
config.insert(
141-
KAFKA_LOG_DIRS.to_string(),
142-
Some("/stackable/data/topicdata".to_string()),
143-
);
144-
145-
// KRAFT
146-
if resource.is_controller_configured() {
147-
config.insert(
148-
KAFKA_PROCESS_ROLES.to_string(),
149-
Some(KafkaRole::Broker.to_string()),
150-
);
151-
152-
config.insert(
153-
"controller.listener.names".to_string(),
154-
Some(KafkaListenerName::Controller.to_string()),
155-
);
156-
}
157-
// OPA
158-
if resource.spec.cluster_config.authorization.opa.is_some() {
159-
config.insert(
160-
"authorizer.class.name".to_string(),
161-
Some("org.openpolicyagent.kafka.OpaAuthorizer".to_string()),
162-
);
163-
config.insert(
164-
"opa.authorizer.metrics.enabled".to_string(),
165-
Some("true".to_string()),
166-
);
167-
}
168-
}
169-
170-
Ok(config)
133+
Ok(BTreeMap::new())
171134
}
172135
}

rust/operator-binary/src/resource/configmap.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,6 @@ pub fn build_rolegroup_config_map(
102102
resolved_product_image.product_version.starts_with("3.7"), // needs_quorum_voters
103103
)?;
104104

105-
// Need to call this to get configOverrides :(
106-
kafka_config.extend(
107-
rolegroup_config
108-
.get(&PropertyNameKind::File(kafka_config_file_name.to_string()))
109-
.cloned()
110-
.unwrap_or_default(),
111-
);
112-
113105
match merged_config {
114106
AnyConfig::Broker(_) => kafka_config.extend(kafka_security.broker_config_settings()),
115107
AnyConfig::Controller(_) => {
@@ -119,6 +111,14 @@ pub fn build_rolegroup_config_map(
119111

120112
kafka_config.extend(graceful_shutdown_config_properties());
121113

114+
// Need to call this to get configOverrides :(
115+
kafka_config.extend(
116+
rolegroup_config
117+
.get(&PropertyNameKind::File(kafka_config_file_name.to_string()))
118+
.cloned()
119+
.unwrap_or_default(),
120+
);
121+
122122
let kafka_config = kafka_config
123123
.into_iter()
124124
.map(|(k, v)| (k, Some(v)))

0 commit comments

Comments
 (0)