Whitespace tweaks in cluster controller and agent scripts

This commit is contained in:
Christian Kreibich 2021-12-14 18:52:16 -08:00
parent e9bdaebc70
commit aceb05099a
6 changed files with 16 additions and 16 deletions

View file

@ -4,7 +4,7 @@ module ClusterAgent;
export { export {
# The name this agent uses to represent the cluster instance # The name this agent uses to represent the cluster instance
# it manages. When the environment variable isn't set and there's, # it manages. When the environment variable isn't set and there's,
# no redef, this falls back to "agent-<hostname>". # no redef, this falls back to "agent-<hostname>".
const name = getenv("ZEEK_AGENT_NAME") &redef; const name = getenv("ZEEK_AGENT_NAME") &redef;
@ -33,7 +33,7 @@ export {
$address="0.0.0.0", $bound_port=0/unknown] &redef; $address="0.0.0.0", $bound_port=0/unknown] &redef;
# Agent and controller currently log only, not via the data cluster's # Agent and controller currently log only, not via the data cluster's
# logger. (This might get added later.) For now, this means that # logger. (This might get added later.) For now, this means that
# if both write to the same log file, it gets garbled. The following # if both write to the same log file, it gets garbled. The following
# lets you specify the working directory specifically for the agent. # lets you specify the working directory specifically for the agent.
const directory = "" &redef; const directory = "" &redef;
@ -53,8 +53,8 @@ function instance(): ClusterController::Types::Instance
{ {
local epi = endpoint_info(); local epi = endpoint_info();
return ClusterController::Types::Instance($name=epi$id, return ClusterController::Types::Instance($name=epi$id,
$host=to_addr(epi$network$address), $host=to_addr(epi$network$address),
$listen_port=epi$network$bound_port); $listen_port=epi$network$bound_port);
} }
function endpoint_info(): Broker::EndpointInfo function endpoint_info(): Broker::EndpointInfo

View file

@ -185,7 +185,7 @@ event zeek_init()
Broker::peer(supervisor_addr, Broker::default_port, Broker::default_listen_retry); Broker::peer(supervisor_addr, Broker::default_port, Broker::default_listen_retry);
# Agents need receive communication targeted at it, and any responses # Agents need receive communication targeted at it, and any responses
# from the supervisor. # from the supervisor.
Broker::subscribe(agent_topic); Broker::subscribe(agent_topic);
Broker::subscribe(SupervisorControl::topic_prefix); Broker::subscribe(SupervisorControl::topic_prefix);
@ -210,8 +210,8 @@ event zeek_init()
{ {
# We connect to the controller. # We connect to the controller.
Broker::peer(ClusterAgent::controller$address, Broker::peer(ClusterAgent::controller$address,
ClusterAgent::controller$bound_port, ClusterAgent::controller$bound_port,
ClusterController::connect_retry); ClusterController::connect_retry);
} }
else else
{ {

View file

@ -40,7 +40,7 @@ export {
const role = ClusterController::Types::NONE &redef; const role = ClusterController::Types::NONE &redef;
# Agent and controller currently log only, not via the data cluster's # Agent and controller currently log only, not via the data cluster's
# logger. (This might get added later.) For now, this means that # logger. (This might get added later.) For now, this means that
# if both write to the same log file, it gets garbled. The following # if both write to the same log file, it gets garbled. The following
# lets you specify the working directory specifically for the agent. # lets you specify the working directory specifically for the agent.
const directory = "" &redef; const directory = "" &redef;

View file

@ -53,8 +53,8 @@ event ClusterAgent::API::notify_agent_hello(instance: string, host: addr, api_ve
event ClusterAgent::API::notify_change(instance: string, n: ClusterController::Types::Node, event ClusterAgent::API::notify_change(instance: string, n: ClusterController::Types::Node,
old: ClusterController::Types::State, old: ClusterController::Types::State,
new: ClusterController::Types::State) new: ClusterController::Types::State)
{ {
# XXX TODO # XXX TODO
} }
@ -96,10 +96,10 @@ event ClusterAgent::API::set_configuration_response(reqid: string, result: Clust
return; return;
# All set_configuration requests to instances are done, so respond # All set_configuration requests to instances are done, so respond
# back to client. We need to compose the result, aggregating # back to client. We need to compose the result, aggregating
# the results we got from the requests to the agents. In the # the results we got from the requests to the agents. In the
# end we have one Result per instance requested in the # end we have one Result per instance requested in the
# original set_configuration_request. # original set_configuration_request.
# #
# XXX we can likely generalize result aggregation in the request module. # XXX we can likely generalize result aggregation in the request module.
for ( i in req$set_configuration_state$requests ) for ( i in req$set_configuration_state$requests )

View file

@ -27,7 +27,7 @@ export {
}; };
# The redef is a workaround so we can use the Request type # The redef is a workaround so we can use the Request type
# while it is still being defined # while it is still being defined
redef record Request += { redef record Request += {
results: ClusterController::Types::ResultVec &default=vector(); results: ClusterController::Types::ResultVec &default=vector();
finished: bool &default=F; finished: bool &default=F;

View file

@ -37,7 +37,7 @@ export {
Stopped, # Explicitly stopped Stopped, # Explicitly stopped
Failed, # Failed to start; and permanently halted Failed, # Failed to start; and permanently halted
Crashed, # Crashed, will be restarted, Crashed, # Crashed, will be restarted,
Unknown, # State not known currently (e.g., because of lost connectivity) Unknown, # State not known currently (e.g., because of lost connectivity)
}; };
## Configuration describing a Cluster Node process. ## Configuration describing a Cluster Node process.