mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Management framework: augment deployed configs with instance IP addresses
The controller learns IP addresses from agents that peer with it, but that information has so far gotten lost when resulting configs get pushed out to the agents. This makes these updates include that information.
This commit is contained in:
parent
742f7fe340
commit
8a4fb0ee19
1 changed files with 18 additions and 0 deletions
|
@ -186,6 +186,24 @@ global g_configs: table[ConfigState] of Management::Configuration
|
|||
|
||||
function config_deploy_to_agents(config: Management::Configuration, req: Management::Request::Request)
|
||||
{
|
||||
# Make any final changes to the configuration we send off.
|
||||
|
||||
# If needed, fill in agent IP address info as learned from their peerings.
|
||||
# XXX this will need revisiting when we support host names.
|
||||
local instances: set[Management::Instance];
|
||||
|
||||
for ( inst in config$instances )
|
||||
{
|
||||
if ( inst$name in g_instances_known
|
||||
&& inst$host == 0.0.0.0
|
||||
&& g_instances_known[inst$name]$host != 0.0.0.0 )
|
||||
inst$host = g_instances_known[inst$name]$host;
|
||||
|
||||
add instances[inst];
|
||||
}
|
||||
|
||||
config$instances = instances;
|
||||
|
||||
for ( name in g_instances )
|
||||
{
|
||||
if ( name !in g_instances_ready )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue