-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Filter space aware entities in Fleet UI/API #184869
[Fleet] Filter space aware entities in Fleet UI/API #184869
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
0fce71c
to
77d1b3c
Compare
77d1b3c
to
a6ec617
Compare
/ci |
cc01e74
to
7b1baf9
Compare
/ci |
7b1baf9
to
2c193b6
Compare
/ci |
fa8f3a3
to
9716075
Compare
/ci |
6c2e51b
to
7b950e0
Compare
/ci |
Pinging @elastic/fleet (Team:Fleet) |
@@ -46,11 +68,12 @@ export async function getAgentsPerOutput( | |||
|
|||
const { items: agentPolicies } = await agentPolicyService.list(soClient, { | |||
esClient, | |||
withAgentCount: true, |
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 the withAgentCount
parameter still used elsewhere to call agentPolicyService.list
?
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.
Looks like it's used in observability_solution, I reverted that change, and use a scoped to space saved object client instead
The code looks good, I tried to test locally on the UI to create an agent policy in a new space, but it's visible in Default space also. Is this supposed to work? |
@juliaElastic Did you turn on the |
No, that was probably the issue, thanks. |
@juliaElastic thanks for the testing
It's not sure what we should do in that case, we should probably be able to enroll agents, but I created another issue to tackle that #186045
Are you running the latest snapshot of Fleet server? It needs that fleet-server change to work elastic/fleet-server#3535 |
It seems I had an old snapshot, I can see the agent under the custom space with the newest one. |
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.
LGTM
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]History
To update your PR or re-run it, just comment with: cc @nchaulet |
Summary
Related to https://github.com/elastic/ingest-dev/issues/2893
That PR allow to filter all the different Fleet documents to only display the one in the current space.
For this every saved object client we use need to be correctly scoped to use the request current space, and we need to add filter
.fleet-*
index to only return the currrent namespace documents.The feature is behind the
useSpaceAwareness
feature flag.I am still working on writing tests, but it should be ready for first reviews
UI
The UI now filter related Fleet entities by space
API
Tests
Manual test, with the
useSpaceAwareness
feature flag enabled, you could create multiple space, and enroll create agent policies/enroll agent in multiple space and check those agent are not visible in the other spacesAutomated API tests
The following APIs should be covered with automated API integration tests
Not done in that PR
space aware agent actions, and the related write APIs are not done in that PR to keep it reviewable.