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] Do not allow user to add agent to managed policy #122676

Conversation

nchaulet
Copy link
Member

Summary

Resolve #122298

This PR hide the add agent button for managed policy in the agent policy details.

I used this as the opportunity to do some refacto and break the agent details index component in multiple components, this way we can easily add unit tests here in the future.

UI Change

managed policy

Screen Shot 2022-01-11 at 11 45 26 AM

non managed

Screen Shot 2022-01-11 at 11 45 19 AM

storybook

Screen Shot 2022-01-11 at 11 53 06 AM

@nchaulet nchaulet added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team auto-backport Deprecated - use backport:version if exact versions are needed v8.1.0 v7.17.0 labels Jan 11, 2022
@nchaulet nchaulet self-assigned this Jan 11, 2022
@nchaulet nchaulet requested a review from a team as a code owner January 11, 2022 16:58
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

agentPolicyId={(agentPolicy && agentPolicy.id) || ''}
showAgentText
/>
) : agentPolicy?.is_managed ? (
Copy link
Member Author

@nchaulet nchaulet Jan 11, 2022

Choose a reason for hiding this comment

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

Actually this is the only behavior change in that PR

@nchaulet
Copy link
Member Author

@elasticmachine merge upstream

Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

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

PR change is simple, and refactoring looks good. Thanks for this. 🚀

@nchaulet
Copy link
Member Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
fleet 550 553 +3

Async chunks

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

id before after diff
fleet 642.9KB 643.4KB +563.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
fleet 42 41 -1

Total ESLint disabled count

id before after diff
fleet 49 48 -1

History

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

cc @nchaulet

@nchaulet nchaulet merged commit 5f76e79 into elastic:main Jan 11, 2022
@nchaulet nchaulet deleted the fix-122298-user-is-able-to-add-agent-managed-policy branch January 11, 2022 20:55
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 11, 2022
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.0
7.17 Backport failed because of merge conflicts

How to fix

Re-run the backport manually:

node scripts/backport --pr 122676

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

Questions ?

Please refer to the Backport tool documentation

nchaulet added a commit to nchaulet/kibana that referenced this pull request Jan 11, 2022
)

(cherry picked from commit 5f76e79)

# Conflicts:
#	x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/index.tsx
kibanamachine added a commit that referenced this pull request Jan 11, 2022
…122709)

(cherry picked from commit 5f76e79)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
nchaulet added a commit that referenced this pull request Jan 11, 2022
) (#122712)

* [Fleet] Do not allow user to add agent to managed policy (#122676)

(cherry picked from commit 5f76e79)

# Conflicts:
#	x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/index.tsx

* fix merge errors
@dikshachauhan-qasource
Copy link

Hi @nchaulet

In concern to above available PR merges, I would like to update you that, the functionality was broken on Integrations tab and not on Policy tab.

So the merges above made are not effective, as on policy detail page on cloud env we already have a fleet server that is in offline mode, so no 'add agent' option is available. [Steps here used are: create a deployment with APM and fleet enabled... later go back to deployment page and delete apm and fleet section. Now UI will be available as shown below.]

image

image

However, If we go to Integration tab, and look for Fleet server integration, From there under Integration policies tab, we are able to add agent under Managed policies.
image

image

So could you please look into this.

Thanks
QAS

@dikshachauhan-qasource
Copy link

Hi @nchaulet

Just a Reminder that this is still pending. Whenever, new merges will be available. We will retest this.

Thanks
QAS

@nchaulet
Copy link
Member Author

Hi @dikshachauhan-qasource thanks for checking on this this should have been addressed with that PR #123160 merged in 7.17 and 8.0 too

@dikshachauhan-qasource
Copy link

Hi @nchaulet

Thanks for info on related new PR. Further, we have validated the ticket changes under related PR and provided observations there.

Thanks
QAS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.17.0 v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] User is able to install Fleet server using managed policy.
6 participants