-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fleet] Actions menu for Fleet agents has correct agent count and bul…
…k actions are correctly processed for all selected agents (#177035) ## Summary Closes #167269 Closes #171914 Closes #167241 Changes: - Agent count in `Actions` menu includes all selectable agents across all pages, including agents with inactive status. - `Actions` menu items are enabled if at least one agent is selected, no matter its status. - Fix bug where managed agents could be accidentally selected in query mode when changing filtering. - Changing agent status or agent policy filtering while in bulk selection mode sets selection mode back to manual. This is to avoid a bad state where bulk selection mode is still enabled and more (unselected) agents are listed. - Fix the bulk selection query when some agents are excluded (managed agent policies). - Agent upgrades in bulk selection mode includes all selected agents, including agents with inactive status. - Agent policy reassign in bulk selection mode includes all selected agents, including agents with inactive status. ### Steps for testing Cf. screen recording below. #### Setup 1. Enroll a Fleet Server with a managed agent policy (e.g. by making sure the preconfigured agent policy for Fleet Server has `is_managed: true`). 2. Create agent policy "Agent policy 1". In the agent policy settings, set the inactivity timeout to a low value, e.g. 10 seconds. 3. Enroll 7 agents on agent policy "Agent policy 1" (e.g. with Horde). Once they are enrolled, kill the agents: they will become inactive in Fleet. 4. Create agent policy "Agent policy 2". Enroll 7 agents on it. #### UI 1. In the Agents table, change the filtering to include inactive status. You should see 15 agents: 7 Healthy, 7 Inactive, 1 (Healthy) Fleet Server. The Fleet Server should not be manually selectable (managed agent policy). 2. Select one inactive agent. In the Actions menu, the agent count should be 1 and actions should be available. NB: the action to schedule an upgrade requires Platinum license, so it may be disabled. 3. Manually select all agents: above the table, it should say `Showing 15 agents | 14 agents selected`. In the Actions menu, the agent count should be 14 and actions should be available. 4. Change the number of rows per page to 5; select all agents on the first page and then click `Select everything on all pages` (bulk selection): above the table, it should say `Showing 15 agents | All agents selected`. In the Actions menu, the agent count should be 14 and actions should be available. 5. Go to page 2, where 2 Healthy and 3 Inactive agents should be listed. Bulk select all agents again. Change the filtering to exclude inactive status: there should be 3 remaining agents (2 Healthy and Fleet Server) and Fleet Server should not be selected. Above the table, it should say `Showing 8 agents | 2 agents selected`. In the Actions menu, the agent count should be 2 and actions should be available. 6. Change the filtering to include inactive status again: you should see 2 selected Healthy agents and 3 unselected Inactive agents. Above the table, it should say `Showing 15 agents | 2 agents selected`. In the Actions menu, the agent count should be 2 and actions should be available. #### Bulk agent actions 1. Bulk select all 14 agents (7 Healthy, 7 Inactive) and, in the Actions menu, click "Upgrade 14 agents". The upgrade should be kicked off for all agents. In the Agents Activity flyout, you should be able to follow the upgrades for the 14 agents. 2. Create a new agent policy "Agent policy 3". Bulk select all 14 agents (7 Healthy, 7 Inactive). In the Actions menu, click "Assign to new policy" and select "Agent policy 3". All 14 agents should be reassigned to the new policy (NB: Inactive agents will get Offline status). 3. Bulk select all 14 agents (7 Healthy, 7 Inactive) and, in the Actions menu, click "Unenroll 14 agents". All agents should be unrenrolled. ### Screen recording The following recording shows the main UI fixes: - Bulk selection with inactive agents gets correct agent count - Changing the filtering in bulk selection mode changes to manual mode - Managed policy agent cannot be selected https://github.com/elastic/kibana/assets/23701614/e52b225c-2951-4729-8903-551fcc793068 ### Checklist - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
87df7ab
commit 7e8ee65
Showing
16 changed files
with
133 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.