Skip to content

Commit c989634

Browse files
authored
[Fleet] Update query in delete unenrolled agents task (#224808)
## Summary Issue reported by users that some unenrolled agents on the UI are not being deleted by the background task. The cause turned out to be a discrepancy in how unenrolled agents are determined on the UI versus the background task. The UI shows agents as unenrolled if `active:false` field matches (logic [here](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/fleet/server/services/agents/build_status_runtime_field.ts#L115-L119)) The delete unenrolled agents task also queried on the existence of `unenrolled_at` field. It seems some agents don't have this field set, those should be deleted too.
1 parent 0176ea9 commit c989634

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

x-pack/platform/plugins/shared/fleet/server/tasks/delete_unenrolled_agents_task.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ export class DeleteUnenrolledAgentsTask {
116116
active: false,
117117
},
118118
},
119-
{ exists: { field: 'unenrolled_at' } },
120119
],
121120
},
122121
},

0 commit comments

Comments
 (0)