<#841 fix: default query/carve to all active nodes...
# osctrl
g
#841 fix: default query/carve to all active nodes when no targets specified Pull request opened by alvarofraguas Summary • When no target filters (envs, platforms, UUIDs, hosts, tags) are provided to
CreateQueryCarve
, the function returned an empty slice — silently targeting zero nodes • The legacy admin blocked this client-side with a modal warning, but the API and React SPA allowed empty-target submissions through • Now defaults to all active nodes in the environment when no filters are specified, matching operator expectation Context The
Intersect()
utility returns
slice2
when
slice1
is empty, but when
targetNodesID
starts as
[]uint{}
and no target blocks execute, it stays empty. Downstream,
QueriesRunHandler
/
CarvesRunHandler
check
if len(targetNodesID) != 0
— so the query/carve was created but never dispatched to any node. Test plan • Run a query with no targets selected → should target all active nodes in the environment • Run a carve with no targets selected → same behavior • Run a query with specific targets → unchanged behavior • Verify the SPA's "No targets selected — the query will fire against all nodes in this env" message is now accurate jmpsec/osctrl