Skip to content

Commit

Permalink
Fix oldStuckInUpdatingKuery
Browse files Browse the repository at this point in the history
Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
  • Loading branch information
jillguyonnet and juliaElastic authored Mar 3, 2025
1 parent 08aaf9c commit 1839863
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export class AutomaticAgentUpgradeTask {
// As an imperfect alternative, sort agents by version. Since versions sort alphabetically, this will not always result in ascending semver sorting.
const statusKuery =
'(status:online OR status:offline OR status:enrolling OR status:degraded OR status:error OR status:orphaned)'; // active status except updating
const oldStuckInUpdatingKuery = `(NOT upgrade_details AND status:updating AND NOT upgraded_at AND upgrade_started_at < now-2h)`; // agents pre 8.12.0 (without upgrade_details)
const oldStuckInUpdatingKuery = `(NOT upgrade_details AND status:updating AND NOT upgraded_at:* AND upgrade_started_at < now-2h)`; // agents pre 8.12.0 (without upgrade_details)
const newStuckInUpdatingKuery = `(NOT upgrade_attempts:* AND upgrade_details.target_version:{version} AND upgrade_details.state:UPG_FAILED)`;
const agentsFetcher = await fetchAllAgentsByKuery(esClient, soClient, {
kuery: `policy_id:${agentPolicy.id} AND (${statusKuery} OR ${oldStuckInUpdatingKuery} OR ${newStuckInUpdatingKuery})`,
Expand Down

0 comments on commit 1839863

Please sign in to comment.