-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
base: main
Are you sure you want to change the base?
[Fleet] Use space prefixed default fleet server policy id #197844
Conversation
Pinging @elastic/fleet (Team:Fleet) |
There was a problem hiding this 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' |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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';
💔 Build Failed
Failed CI StepsHistory
cc @nchaulet |
@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 |
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
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.