Remove deprecated Controller::auto_assign_ports and Controller::auto_assign_start_port

This commit is contained in:
Tim Wojtulewicz 2024-08-03 12:14:50 -07:00
parent 7a5b29ea81
commit 535df5e263
2 changed files with 2 additions and 24 deletions

View file

@ -65,13 +65,11 @@ export {
## cluster nodes that need them and don't have them explicitly specified ## cluster nodes that need them and don't have them explicitly specified
## in cluster configurations. ## in cluster configurations.
const auto_assign_broker_ports = T &redef; const auto_assign_broker_ports = T &redef;
const auto_assign_ports = T &redef &deprecated="Remove in v7.1: replaced by auto_assign_broker_ports.";
## The TCP start port to use for auto-assigning cluster node listening ## The TCP start port to use for auto-assigning cluster node listening
## ports, if :zeek:see:`Management::Controller::auto_assign_broker_ports` is ## ports, if :zeek:see:`Management::Controller::auto_assign_broker_ports` is
## enabled (the default) and nodes don't come with those ports assigned. ## enabled (the default) and nodes don't come with those ports assigned.
const auto_assign_broker_start_port = 2200/tcp &redef; const auto_assign_broker_start_port = 2200/tcp &redef;
const auto_assign_start_port = 2200/tcp &redef &deprecated="Remove in v7.1: replaced by auto_assign_broker_start_port.";
## Whether the controller should auto-assign metrics ports for Prometheus ## Whether the controller should auto-assign metrics ports for Prometheus
## to nodes that need them and don't have them explicitly specified in ## to nodes that need them and don't have them explicitly specified in

View file

@ -335,12 +335,6 @@ function config_assign_broker_ports(config: Management::Configuration)
# instances. # instances.
local start_port = Management::Controller::auto_assign_broker_start_port; local start_port = Management::Controller::auto_assign_broker_start_port;
@pragma push ignore-deprecations
# Keep deprecated config setting working until 7.1:
if ( Management::Controller::auto_assign_start_port != 2200/tcp )
start_port = Management::Controller::auto_assign_start_port;
@pragma pop ignore-deprecations
local p = port_to_count(start_port); local p = port_to_count(start_port);
# A set that tracks the ports we've used so far. Helpful for avoiding # A set that tracks the ports we've used so far. Helpful for avoiding
@ -613,17 +607,10 @@ function config_validate(config: Management::Configuration,
# ports. Verify this both for Broker's ports and the metrics export # ports. Verify this both for Broker's ports and the metrics export
# ones. # ones.
@pragma push ignore-deprecations
# Keep deprecated config setting working until 7.1:
local auto_broker_ports = Management::Controller::auto_assign_broker_ports;
if ( ! Management::Controller::auto_assign_ports )
auto_broker_ports = F;
@pragma pop ignore-deprecations
local nodes: vector of string; local nodes: vector of string;
local nodes_str: string; local nodes_str: string;
if ( ! auto_broker_ports ) if ( ! Management::Controller::auto_assign_broker_ports )
{ {
nodes = config_nodes_lacking_broker_ports(config); nodes = config_nodes_lacking_broker_ports(config);
@ -1042,17 +1029,10 @@ event Management::Controller::API::stage_configuration_request(reqid: string, co
g_configs[STAGED] = config; g_configs[STAGED] = config;
config_copy = copy(config); config_copy = copy(config);
@pragma push ignore-deprecations if ( Management::Controller::auto_assign_broker_ports )
# Keep deprecated config setting working until 7.1:
local auto_broker_ports = Management::Controller::auto_assign_broker_ports;
if ( ! Management::Controller::auto_assign_ports )
auto_broker_ports = F;
if ( auto_broker_ports )
config_assign_broker_ports(config_copy); config_assign_broker_ports(config_copy);
if ( Management::Controller::auto_assign_metrics_ports ) if ( Management::Controller::auto_assign_metrics_ports )
config_assign_metrics_ports(config_copy); config_assign_metrics_ports(config_copy);
@pragma pop ignore-deprecations
g_configs[READY] = config_copy; g_configs[READY] = config_copy;