mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
check for active fleet servers (#207920)
## Summary The Upgrade Assistant deprecations for Native Connectors -> Agentless Connectors care about if Fleet Server is _actively_ running, but it seems that the check we're using is whether one was _ever_ running. This change introduces an optional `activeOnly` param to `hasFleetServer`, and uses it for these deprecations.
This commit is contained in:
parent
ae8be0d485
commit
3fde9d6ae9
2 changed files with 8 additions and 4 deletions
|
@ -86,16 +86,19 @@ export const hasFleetServersForPolicies = async (
|
|||
};
|
||||
|
||||
/**
|
||||
* Check if at least one fleet server agent exists, regardless of its online status
|
||||
* Check if at least one fleet server agent exists.
|
||||
* `activeOnly` flag can be used to filter only active agents.
|
||||
*/
|
||||
export async function hasFleetServers(
|
||||
esClient: ElasticsearchClient,
|
||||
soClient: SavedObjectsClientContract
|
||||
soClient: SavedObjectsClientContract,
|
||||
activeOnly: boolean = false
|
||||
) {
|
||||
return await hasFleetServersForPolicies(
|
||||
esClient,
|
||||
soClient,
|
||||
await getFleetServerPolicies(soClient)
|
||||
await getFleetServerPolicies(soClient),
|
||||
activeOnly
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,8 @@ export const getRegisteredDeprecations = (
|
|||
const hasAgentless = isAgentlessEnabled();
|
||||
const hasFleetServer = await hasFleetServers(
|
||||
ctx.esClient.asInternalUser,
|
||||
ctx.savedObjectsClient
|
||||
ctx.savedObjectsClient,
|
||||
true // only counts if the Fleet Server is active
|
||||
);
|
||||
const entSearchDetails = getEnterpriseSearchNodeDeprecation(config, cloud, docsUrl);
|
||||
const [crawlerDetails, nativeConnectorsDetails] = await Promise.all([
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue