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] Use space prefixed default fleet server policy id #197844

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented Oct 25, 2024

Summary

Resolve #193149

Make the fleet server policy id prefixed by the spaceId when non in the default space. To avoid conflict between fleet server hosts policies in multiple space.

UI Changes

In the space test

Screenshot 2024-10-25 at 12 28 39 PM

Tests

You can test the changing by enabling space awareness (feature flag + API call, see dev doc)

I add an API test to verify the generated id on different space.

@nchaulet nchaulet marked this pull request as ready for review October 25, 2024 17:11
@nchaulet nchaulet requested a review from a team as a code owner October 25, 2024 17:11
@nchaulet nchaulet added release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Oct 25, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@nchaulet nchaulet self-assigned this Oct 25, 2024
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.

The code changes look good to me but I'm wondering what is the intended behavior regarding Fleet Server(s) in different spaces. I went back to the product doc but it wasn't clear. @nimarezainia Should each space need its own unique Fleet Server policy?

@@ -13,6 +13,12 @@ import {
FLEET_ENDPOINT_PACKAGE,
} from '../constants';

export function getDefaultFleetServerpolicyId(spaceId?: string) {
return !spaceId || spaceId === '' || spaceId === 'default'
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to compare using DEFAULT_NAMESPACE_STRING from @kbn/core-saved-objects-utils-server? (not sure if that can be imported into common)

Copy link
Member Author

Choose a reason for hiding this comment

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

I was able to import it from '@kbn/spaces-plugin/common';

@elasticmachine
Copy link
Contributor

💔 Build Failed

Failed CI Steps

History

cc @nchaulet

@nchaulet
Copy link
Member Author

The code changes look good to me but I'm wondering what is the intended behavior regarding Fleet Server(s) in different spaces. I went back to the product doc but it wasn't clear. @nimarezainia Should each space need its own unique Fleet Server policy?

@jen-huang I think it most scenarios we will have a fleet server defined in one space and no need for users to add a new one in other spaces, but if they need to add one the fleet server policy will have to have a different id this is what that PR fix

@jen-huang
Copy link
Contributor

@jen-huang I think it most scenarios we will have a fleet server defined in one space and no need for users to add a new one in other spaces, but if they need to add one the fleet server policy will have to have a different id this is what that PR fix

So even if the first fleet server policy is created in secondary space test, the default space and rest of spaces will use test-fleet-server-policy by default?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
3 participants