Management framework: bugfix for a get_id_value corner case

For the case of a running cluster with no connected agents, use the
g_instances_known table instead of g_instances. The latter reflects the contents
of the last deployed config, not the live scenario of actually attached agents.
This commit is contained in:
Christian Kreibich 2022-06-22 16:31:38 -07:00
parent 1af9bba76e
commit 05447c413f

View file

@ -1166,7 +1166,7 @@ event Management::Controller::API::get_id_value_request(reqid: string, id: strin
local res: Management::Result; local res: Management::Result;
# Special case: if we have no instances, respond right away. # Special case: if we have no instances, respond right away.
if ( |g_instances| == 0 ) if ( |g_instances_known| == 0 )
{ {
Management::Log::info(fmt("tx Management::Controller::API::get_id_value_response %s", reqid)); Management::Log::info(fmt("tx Management::Controller::API::get_id_value_response %s", reqid));
res = Management::Result($reqid=reqid, $success=F, $error="no instances connected"); res = Management::Result($reqid=reqid, $success=F, $error="no instances connected");