Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fleet] Allow some agent actions for managed policies #155923

Merged

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented Apr 26, 2023

Summary

Resolve #155294

That PR allow agent actions for managed policy:

  • Show request diagnostics in agent table and agent details
  • View agent JSON in agent details

UI Changes

Screenshot 2023-04-26 at 2 36 49 PM

Screenshot 2023-04-27 at 8 11 32 AM

Tests

I added a unit test to cover that

You can manually test that by enrolling an agent into a managed policy and check the button is enabled

@nchaulet nchaulet added release_note:skip Skip the PR/issue when compiling release notes v8.8.0 labels Apr 26, 2023
@nchaulet nchaulet requested a review from a team as a code owner April 26, 2023 18:39
@nchaulet nchaulet self-assigned this Apr 26, 2023
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Apr 26, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@nchaulet
Copy link
Member Author

@elasticmachine merge upstream

@jen-huang
Copy link
Contributor

@nchaulet Sorry to expand the scope, I didn't see this PR was already up, but would you mind incorporating my feedback here?: #155294 (comment) 🙏

@nchaulet nchaulet changed the title [Fleet] Show request diagnostics for managed policy in agent table [Fleet] Allow some agent actions for managed policies Apr 26, 2023
@nchaulet
Copy link
Member Author

@jen-huang just updated my PR with that changes

Copy link
Contributor

@jen-huang jen-huang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small suggestion, otherwise LGTM. Thanks for the tests!

@@ -67,7 +67,7 @@ export const AgentDetailsActionMenu: React.FunctionComponent<{
onClick={() => {
setIsReassignFlyoutOpen(true);
}}
disabled={!agent.active}
disabled={!agent.active || agentPolicy?.is_managed}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the UX would be less confusing if we hid these options instead of disabling them

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure I will make the change

@nchaulet nchaulet enabled auto-merge (squash) April 27, 2023 12:28
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #32 / uptime uptime REST endpoints with generated data certs api when data is present retrieves expected cert data

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 959.7KB 959.9KB +183.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 17 19 +2
securitySolution 399 402 +3
total +5

Total ESLint disabled count

id before after diff
enterpriseSearch 18 20 +2
securitySolution 479 482 +3
total +5

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @nchaulet

@nchaulet nchaulet merged commit f06e55f into elastic:main Apr 27, 2023
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Apr 27, 2023
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.8

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Apr 27, 2023
…#156007)

# Backport

This will backport the following commits from `main` to `8.8`:
- [[Fleet] Allow some agent actions for managed policies
(#155923)](#155923)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nicolas
Chaulet","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-04-27T13:14:09Z","message":"[Fleet]
Allow some agent actions for managed policies
(#155923)","sha":"f06e55f500d84df9b281e912e68338e83ee9b3bc","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v8.8.0","v8.9.0"],"number":155923,"url":"https://github.com/elastic/kibana/pull/155923","mergeCommit":{"message":"[Fleet]
Allow some agent actions for managed policies
(#155923)","sha":"f06e55f500d84df9b281e912e68338e83ee9b3bc"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/155923","number":155923,"mergeCommit":{"message":"[Fleet]
Allow some agent actions for managed policies
(#155923)","sha":"f06e55f500d84df9b281e912e68338e83ee9b3bc"}}]}]
BACKPORT-->

Co-authored-by: Nicolas Chaulet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.8.0 v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] Request diagnostics action should be available on managed agents
6 participants