Skip to content

Commit

Permalink
fix: Invert peer-cluster endpoints post "center of star" change
Browse files Browse the repository at this point in the history
  • Loading branch information
Batalex committed Oct 17, 2024
1 parent 03ecf31 commit 06b9b9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/managers/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,9 +604,7 @@ def server_properties(self) -> list[str]:
if self.state.cluster.tls_enabled and self.state.unit_broker.certificate:
properties += self.tls_properties + self.zookeeper_tls_properties

# FIXME: change peer_cluster_relation to peer_cluster_orchestrator_relations after the center-of-star
# change is effective
if self.state.runs_balancer or self.state.peer_cluster_relation:
if self.state.runs_balancer or self.state.peer_cluster_orchestrator_relation:
properties += KAFKA_CRUISE_CONTROL_OPTIONS.splitlines()
properties += self.metrics_reporter_properties

Expand Down
6 changes: 2 additions & 4 deletions tests/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
JVM_MEM_MIN_GB,
OAUTH_REL_NAME,
PEER,
PEER_CLUSTER_RELATION,
PEER_CLUSTER_ORCHESTRATOR_RELATION,
SUBSTRATE,
ZK,
)
Expand Down Expand Up @@ -555,9 +555,7 @@ def test_cruise_control_reporter_only_with_balancer(harness: Harness[KafkaCharm]
# Default roles value does not include balancer
assert reporters_config_value not in harness.charm.broker.config_manager.server_properties

# FIXME: change peer_cluster_relation to peer_cluster_orchestrator_relations after the center-of-star
# change is effective
with harness.hooks_disabled():
harness.add_relation(PEER_CLUSTER_RELATION, "balancer")
harness.add_relation(PEER_CLUSTER_ORCHESTRATOR_RELATION, "broker")

assert reporters_config_value in harness.charm.broker.config_manager.server_properties

0 comments on commit 06b9b9f

Please sign in to comment.