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

When deleting an agent policy, only delete integration policies if no other agent policies use it #182222

Closed
1 task done
Tracked by #75867
juliaElastic opened this issue May 1, 2024 · 1 comment · Fixed by #186601
Closed
1 task done
Tracked by #75867
Assignees
Labels
QA:Needs Validation Issue needs to be validated by QA Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@juliaElastic
Copy link
Contributor

juliaElastic commented May 1, 2024

Part of the reusable integration policies work.

Currently agent policy - integration policy is in 1:1 relationship, and when an agent policy is deleted, we delete all integration policies that referenced the agent policy.
With making the integration policies reusable, deleting an agent policy would have the effect of deleting the shared integration policy.

  • When deleting an agent policy, check if the integration policies are used in other agent policies. Only delete those that are not used with other agent policies.

This will probably change again when #182220 is completed, so integration policies don't have to be deleted at all on deleting agent policies.

@botelastic botelastic bot added the needs-team Issues missing a team label label May 1, 2024
@juliaElastic juliaElastic added the Team:Fleet Team label for Observability Data Collection Fleet team label May 1, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@botelastic botelastic bot removed the needs-team Issues missing a team label label May 1, 2024
@kpollich kpollich added the QA:Needs Validation Issue needs to be validated by QA label Jun 6, 2024
@kpollich kpollich assigned criamico and unassigned juliaElastic Jun 12, 2024
criamico added a commit that referenced this issue Jun 24, 2024
…es if no other agent policies use it (#186601)

Closes #182222

## Summary
- If `enableReusableIntegrationPolicies` is enabled, the
`agentPolicyService.delete` method finds the integration policies that
are shared with other agent policies and doesn't delete them.
-  Updated the UI so that the modal shows an info box to the user:

![Screenshot 2024-06-24 at 10 20
53](https://github.com/elastic/kibana/assets/16084106/6db8f225-bfc7-47cf-a49c-adc0e0b794ac)


### Checklist

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QA:Needs Validation Issue needs to be validated by QA Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
4 participants