cluster: allow cluster-layout script to redef cluster backend

This makes testing a bit easier right now, but it's not actually
safe to rely on Cluster::backend for conditional loading.
This commit is contained in:
Arne Welzel 2025-09-24 12:32:59 +02:00
parent 5938b2b96c
commit 3dd95b90c1

View file

@ -15,12 +15,6 @@ redef Broker::log_topic = Cluster::rr_log_topic;
# Add a cluster prefix. # Add a cluster prefix.
@prefixes += cluster @prefixes += cluster
# Broker-specific additions:
@if ( Cluster::backend == Cluster::CLUSTER_BACKEND_BROKER )
@load ./broker-backpressure
@load ./broker-telemetry
@endif
@if ( Supervisor::is_supervised() ) @if ( Supervisor::is_supervised() )
# When running a supervised cluster, populate Cluster::nodes from the node table # When running a supervised cluster, populate Cluster::nodes from the node table
# the Supervisor provides to new Zeek nodes. The management framework configures # the Supervisor provides to new Zeek nodes. The management framework configures
@ -39,6 +33,12 @@ redef Cluster::manager_is_logger = F;
@load cluster-layout @load cluster-layout
@endif @endif
# Broker-specific additions:
@if ( Cluster::backend == Cluster::CLUSTER_BACKEND_BROKER )
@load ./broker-backpressure
@load ./broker-telemetry
@endif
@if ( Cluster::node in Cluster::nodes ) @if ( Cluster::node in Cluster::nodes )
@load ./setup-connections @load ./setup-connections