mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Management framework: distinguish internally and externally requested deployments
The controller's deployment request state now features a bit that indicates whether the deployment was requested by a client, or triggered internally. This affects logging and the transmission of deployment response events via Broker, which are skipped when the deployment is internal. This is in preparation of resilience features when the controller (re-)boots.
This commit is contained in:
parent
7787d84739
commit
3120fbc75e
1 changed files with 26 additions and 12 deletions
|
@ -32,6 +32,9 @@ export {
|
||||||
type DeployState: record {
|
type DeployState: record {
|
||||||
## The cluster configuration the controller is deploying.
|
## The cluster configuration the controller is deploying.
|
||||||
config: Management::Configuration;
|
config: Management::Configuration;
|
||||||
|
## Whether this is a controller-internal deployment, or
|
||||||
|
## triggered via a request by a remote peer/client.
|
||||||
|
is_internal: bool &default=F;
|
||||||
## Request state for every controller/agent transaction.
|
## Request state for every controller/agent transaction.
|
||||||
requests: set[string] &default=set();
|
requests: set[string] &default=set();
|
||||||
};
|
};
|
||||||
|
@ -729,10 +732,14 @@ event Management::Agent::API::deploy_response(reqid: string, results: Management
|
||||||
local res = Management::Result($reqid=req$id, $data=config$id);
|
local res = Management::Result($reqid=req$id, $data=config$id);
|
||||||
req$results += res;
|
req$results += res;
|
||||||
|
|
||||||
Management::Log::info(fmt("tx Management::Controller::API::deploy_response %s",
|
if ( ! req$deploy_state$is_internal )
|
||||||
Management::Request::to_string(req)));
|
{
|
||||||
Broker::publish(Management::Controller::topic,
|
Management::Log::info(fmt("tx Management::Controller::API::deploy_response %s",
|
||||||
Management::Controller::API::deploy_response, req$id, req$results);
|
Management::Request::to_string(req)));
|
||||||
|
Broker::publish(Management::Controller::topic,
|
||||||
|
Management::Controller::API::deploy_response, req$id, req$results);
|
||||||
|
}
|
||||||
|
|
||||||
Management::Request::finish(req$id);
|
Management::Request::finish(req$id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -950,10 +957,14 @@ event Management::Controller::API::deploy_request(reqid: string)
|
||||||
local res = Management::Result($reqid=req$id, $data=config$id);
|
local res = Management::Result($reqid=req$id, $data=config$id);
|
||||||
req$results += res;
|
req$results += res;
|
||||||
|
|
||||||
Management::Log::info(fmt("tx Management::Controller::API::deploy_response %s",
|
if ( ! req$deploy_state$is_internal )
|
||||||
Management::Request::to_string(req)));
|
{
|
||||||
Broker::publish(Management::Controller::topic,
|
Management::Log::info(fmt("tx Management::Controller::API::deploy_response %s",
|
||||||
Management::Controller::API::deploy_response, req$id, req$results);
|
Management::Request::to_string(req)));
|
||||||
|
Broker::publish(Management::Controller::topic,
|
||||||
|
Management::Controller::API::deploy_response, req$id, req$results);
|
||||||
|
}
|
||||||
|
|
||||||
Management::Request::finish(req$id);
|
Management::Request::finish(req$id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1229,10 +1240,13 @@ event Management::Request::request_expired(req: Management::Request::Request)
|
||||||
g_config_reqid_pending = "";
|
g_config_reqid_pending = "";
|
||||||
req$results += res;
|
req$results += res;
|
||||||
|
|
||||||
Management::Log::info(fmt("tx Management::Controller::API::deploy_response %s",
|
if ( ! req$deploy_state$is_internal )
|
||||||
Management::Request::to_string(req)));
|
{
|
||||||
Broker::publish(Management::Controller::topic,
|
Management::Log::info(fmt("tx Management::Controller::API::deploy_response %s",
|
||||||
Management::Controller::API::deploy_response, req$id, req$results);
|
Management::Request::to_string(req)));
|
||||||
|
Broker::publish(Management::Controller::topic,
|
||||||
|
Management::Controller::API::deploy_response, req$id, req$results);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( req?$get_nodes_state )
|
if ( req?$get_nodes_state )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue