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

Pass namespaces to Fleet Server managed documents #3535

Merged
merged 7 commits into from
May 16, 2024

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented May 10, 2024

Description

Resolve #3505

Set the namespaces property in the different .fleet-* document managed by fleet server.

Feature flag? do we need to release that feature under a feature flag, in my opinion if the namespaces are not populated in Kibana fleet server behavior do not change so it should be safe to release this without feature flag.

Test

I added a new integration test to cover the change

Todo

  • Pass namespace during enrollments
  • Pass namespace for actions
  • Pass namespace during file upload
  • Add integrations test for namespace

Questions

  • Policy change should we support changing namespace here ? @kpollich what do you think?

@nchaulet nchaulet self-assigned this May 13, 2024
@nchaulet nchaulet added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label May 13, 2024
@nchaulet nchaulet marked this pull request as ready for review May 13, 2024 17:07
@nchaulet nchaulet requested a review from a team as a code owner May 13, 2024 17:07
@kpollich
Copy link
Member

Policy change should we support changing namespace here ? @kpollich what do you think?

We were initially planning to allow for changing an agent policy's space directly from Fleet UI, e.g.

image

However, it's not clear if this is the direction we'll go. We may direct users to stack management instead, to avoid having multiple sources of truth for object/space management. When the space of an agent policy changes, though, we probably do need to dispatch an action to update the namespaces property on its relevant policy components. I wonder if we could register a callback with stack management that detects when a policy is moved to another space so we can fire off the policy change operation. We might be able to also handle this in a background task that listens for a certain saved object save event - if that's a thing.

Copy link
Contributor

@michel-laterman michel-laterman left a comment

Choose a reason for hiding this comment

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

Looks good so far.
It's good that namespace is kept as an ES document detail and not added to the API that clients use.

Please add a changelog fragment as well

@nchaulet
Copy link
Member Author

We were initially planning to allow for changing an agent policy's space directly from Fleet UI, e.g.

I think we probably can handle the whole namespace change directly from Kibana has we do when reassigning to a policy by updating the .fleet-agents doc

@nchaulet nchaulet merged commit 53ebe67 into main May 16, 2024
8 checks passed
@nchaulet nchaulet deleted the feature-fleet-namespacs branch May 16, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] Support spaces in fleet object created by Fleet Server
4 participants