Skip to content

[Fleet] Allow to move agent policy to another space.#189663

Merged
nchaulet merged 16 commits intoelastic:mainfrom
nchaulet:feature-move-agent-policy-space
Aug 15, 2024
Merged

[Fleet] Allow to move agent policy to another space.#189663
nchaulet merged 16 commits intoelastic:mainfrom
nchaulet:feature-move-agent-policy-space

Conversation

@nchaulet
Copy link
Member

@nchaulet nchaulet commented Jul 31, 2024

Summary

Resolve #182733

Test are failing as it need 189387 to be merged but the PR should be ready for a first pass of review.
#189387 should be merged before (to be able to use updateObjectsSpaces saved object must be multiple.)

API changes

The update agent policy API now accept a space_ids property, when space change, we update the policy saved object (agent policy and package policy). Then we update the related Fleet system indices enrollment tokens and agents.

We only allow to change the spaces to space where the has the AgentPolicies:All privileges.

Introduce a new internal API that return the space a user has access with AgentPolicies:All

/internal/fleet/agent_policies_spaces

UI Changes

Screenshot 2024-08-09 at 9 52 33 AM

Todo

  • Policy Creation

Test

With space awareness enabled (useSpaceAwareness feature flag)

  1. create an agent policy and add agent to that policy
  2. go to settings of that policy and try to change space => verify related entities are updated too.

@obltmachine
Copy link

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

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

@nchaulet nchaulet force-pushed the feature-move-agent-policy-space branch from 687c622 to 0fda816 Compare August 9, 2024 19:15
indexPattern: INGEST_SAVED_OBJECT_INDEX,
hidden: false,
namespaceType: useSpaceAwareness ? 'single' : 'agnostic',
namespaceType: useSpaceAwareness ? 'multiple' : 'agnostic', // TEMP multiple until we address TODO
Copy link
Member Author

Choose a reason for hiding this comment

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

Tmp until this is merged #189387 same for bellow

@nchaulet nchaulet added release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team labels Aug 9, 2024
@nchaulet
Copy link
Member Author

/ci

@nchaulet nchaulet force-pushed the feature-move-agent-policy-space branch from 2aec574 to f2592ec Compare August 12, 2024 18:05
@nchaulet
Copy link
Member Author

/ci

@nchaulet nchaulet force-pushed the feature-move-agent-policy-space branch from 3e5dd04 to 6689e9c Compare August 12, 2024 20:24
@nchaulet nchaulet marked this pull request as ready for review August 12, 2024 20:25
@nchaulet nchaulet requested review from a team as code owners August 12, 2024 20:25
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@kc13greiner kc13greiner self-requested a review August 12, 2024 21:00
@nchaulet nchaulet requested a review from a team as a code owner August 13, 2024 16:24
@nchaulet nchaulet requested a review from parkiino August 13, 2024 16:24
@nchaulet nchaulet requested a review from paul-tavares August 13, 2024 16:24
Copy link
Contributor

@paul-tavares paul-tavares left a comment

Choose a reason for hiding this comment

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

Changes under Security Solution look good 👍

thanks.

Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@kc13greiner kc13greiner left a comment

Choose a reason for hiding this comment

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

LGTM!

@kibana-ci
Copy link

kibana-ci commented Aug 15, 2024

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
fleet 1209 1211 +2

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
fleet 1236 1239 +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 1.8MB 1.8MB +1.9KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fleet 169.3KB 169.6KB +386.0B
Unknown metric groups

API count

id before after diff
fleet 1359 1362 +3

History

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

@nchaulet nchaulet merged commit c2fc468 into elastic:main Aug 15, 2024
@nchaulet nchaulet deleted the feature-move-agent-policy-space branch August 15, 2024 17:19
@kibanamachine kibanamachine added v8.16.0 backport:skip This PR does not require backporting labels Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fleet] Create UI for assisting with moving Agent Policies between spaces

8 participants