mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
fix issue with single agent schedule upgrade (#144604)
This commit is contained in:
parent
3d7a5bb021
commit
cb2f4ba9d9
1 changed files with 10 additions and 9 deletions
|
@ -162,15 +162,16 @@ export const AgentUpgradeAgentModal: React.FunctionComponent<AgentUpgradeAgentMo
|
|||
|
||||
try {
|
||||
setIsSubmitting(true);
|
||||
const { error } = isSingleAgent
|
||||
? await sendPostAgentUpgrade((agents[0] as Agent).id, {
|
||||
version,
|
||||
})
|
||||
: await sendPostBulkAgentUpgrade({
|
||||
version,
|
||||
agents: Array.isArray(agents) ? agents.map((agent) => agent.id) : agents,
|
||||
...rolloutOptions,
|
||||
});
|
||||
const { error } =
|
||||
isSingleAgent && !isScheduled
|
||||
? await sendPostAgentUpgrade((agents[0] as Agent).id, {
|
||||
version,
|
||||
})
|
||||
: await sendPostBulkAgentUpgrade({
|
||||
version,
|
||||
agents: Array.isArray(agents) ? agents.map((agent) => agent.id) : agents,
|
||||
...rolloutOptions,
|
||||
});
|
||||
if (error) {
|
||||
if (error?.statusCode === 400) {
|
||||
setErrors(error?.message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue