Skip to content

Commit

Permalink
Rearrange agent upgrade tests into groups for upgrade & bulk upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
John Schulz committed Mar 18, 2021
1 parent 8f6a6e2 commit 0cbbb41
Show file tree
Hide file tree
Showing 2 changed files with 457 additions and 462 deletions.
23 changes: 8 additions & 15 deletions x-pack/plugins/fleet/server/routes/agent/upgrade_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,14 @@ export const postBulkAgentsUpgradeHandler: RequestHandler<
}

try {
if (Array.isArray(agents)) {
await AgentService.sendUpgradeAgentsActions(soClient, esClient, {
agentIds: agents,
sourceUri,
version,
force,
});
} else {
await AgentService.sendUpgradeAgentsActions(soClient, esClient, {
kuery: agents,
sourceUri,
version,
force,
});
}
const agentOptions = Array.isArray(agents) ? { agentIds: agents } : { kuery: agents };
const upgradeOptions = {
...agentOptions,
sourceUri,
version,
force,
};
await AgentService.sendUpgradeAgentsActions(soClient, esClient, upgradeOptions);

const body: PostBulkAgentUpgradeResponse = {};
return response.ok({ body });
Expand Down
Loading

0 comments on commit 0cbbb41

Please sign in to comment.