[Fleet] Reuse shared integration policies when duplicating agent policies#217872
Merged
jillguyonnet merged 1 commit intoelastic:mainfrom Apr 11, 2025
Conversation
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
|
Contributor
|
Pinging @elastic/fleet (Team:Fleet) |
Member
Author
|
@kpollich Should this change be backported? |
Contributor
|
We should backport at least to 8.19 |
Contributor
|
Starting backport for target branches: 8.x, 9.0 |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Apr 11, 2025
…cies (elastic#217872) ## Summary Closes elastic#215335 Currently, when an agent policy is duplicated, shared integration policies are also duplicated. This PR adds logic where the duplicated agent policy also shares these integration policies. ### Testing * Run ES with an [Entreprise license](https://www.elastic.co/subscriptions) to avail of reusable integration policies. * Create an agent policy with a shared integration policy and a non-shared integration policy. * Duplicate the agent policy: the duplicated policy should only duplicate the non-shared integration policy and the shared integration policy should be reused. ### Checklist - [x] [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 - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Incorrect package policies in duplicated agent policies. (cherry picked from commit 5c78ff1)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Apr 11, 2025
…cies (elastic#217872) ## Summary Closes elastic#215335 Currently, when an agent policy is duplicated, shared integration policies are also duplicated. This PR adds logic where the duplicated agent policy also shares these integration policies. ### Testing * Run ES with an [Entreprise license](https://www.elastic.co/subscriptions) to avail of reusable integration policies. * Create an agent policy with a shared integration policy and a non-shared integration policy. * Duplicate the agent policy: the duplicated policy should only duplicate the non-shared integration policy and the shared integration policy should be reused. ### Checklist - [x] [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 - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Incorrect package policies in duplicated agent policies. (cherry picked from commit 5c78ff1)
Contributor
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kibanamachine
added a commit
that referenced
this pull request
Apr 11, 2025
…t policies (#217872) (#218002) # Backport This will backport the following commits from `main` to `8.x`: - [[Fleet] Reuse shared integration policies when duplicating agent policies (#217872)](#217872) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Jill Guyonnet","email":"jill.guyonnet@elastic.co"},"sourceCommit":{"committedDate":"2025-04-11T15:16:17Z","message":"[Fleet] Reuse shared integration policies when duplicating agent policies (#217872)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/215335\n\nCurrently, when an agent policy is duplicated, shared integration\npolicies are also duplicated. This PR adds logic where the duplicated\nagent policy also shares these integration policies.\n\n### Testing\n\n* Run ES with an [Entreprise\nlicense](https://www.elastic.co/subscriptions) to avail of reusable\nintegration policies.\n* Create an agent policy with a shared integration policy and a\nnon-shared integration policy.\n* Duplicate the agent policy: the duplicated policy should only\nduplicate the non-shared integration policy and the shared integration\npolicy should be reused.\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n### Identify risks\n\nIncorrect package policies in duplicated agent policies.","sha":"5c78ff18484e77b5ec5a4ba2ab341ed65db4f21c","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:Fleet","v9.0.0","backport:version","v9.1.0","v8.19.0"],"title":"[Fleet] Reuse shared integration policies when duplicating agent policies","number":217872,"url":"https://github.com/elastic/kibana/pull/217872","mergeCommit":{"message":"[Fleet] Reuse shared integration policies when duplicating agent policies (#217872)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/215335\n\nCurrently, when an agent policy is duplicated, shared integration\npolicies are also duplicated. This PR adds logic where the duplicated\nagent policy also shares these integration policies.\n\n### Testing\n\n* Run ES with an [Entreprise\nlicense](https://www.elastic.co/subscriptions) to avail of reusable\nintegration policies.\n* Create an agent policy with a shared integration policy and a\nnon-shared integration policy.\n* Duplicate the agent policy: the duplicated policy should only\nduplicate the non-shared integration policy and the shared integration\npolicy should be reused.\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n### Identify risks\n\nIncorrect package policies in duplicated agent policies.","sha":"5c78ff18484e77b5ec5a4ba2ab341ed65db4f21c"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/217872","number":217872,"mergeCommit":{"message":"[Fleet] Reuse shared integration policies when duplicating agent policies (#217872)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/215335\n\nCurrently, when an agent policy is duplicated, shared integration\npolicies are also duplicated. This PR adds logic where the duplicated\nagent policy also shares these integration policies.\n\n### Testing\n\n* Run ES with an [Entreprise\nlicense](https://www.elastic.co/subscriptions) to avail of reusable\nintegration policies.\n* Create an agent policy with a shared integration policy and a\nnon-shared integration policy.\n* Duplicate the agent policy: the duplicated policy should only\nduplicate the non-shared integration policy and the shared integration\npolicy should be reused.\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n### Identify risks\n\nIncorrect package policies in duplicated agent policies.","sha":"5c78ff18484e77b5ec5a4ba2ab341ed65db4f21c"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jill Guyonnet <jill.guyonnet@elastic.co>
kibanamachine
added a commit
that referenced
this pull request
Apr 14, 2025
…t policies (#217872) (#218003) # Backport This will backport the following commits from `main` to `9.0`: - [[Fleet] Reuse shared integration policies when duplicating agent policies (#217872)](#217872) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Jill Guyonnet","email":"jill.guyonnet@elastic.co"},"sourceCommit":{"committedDate":"2025-04-11T15:16:17Z","message":"[Fleet] Reuse shared integration policies when duplicating agent policies (#217872)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/215335\n\nCurrently, when an agent policy is duplicated, shared integration\npolicies are also duplicated. This PR adds logic where the duplicated\nagent policy also shares these integration policies.\n\n### Testing\n\n* Run ES with an [Entreprise\nlicense](https://www.elastic.co/subscriptions) to avail of reusable\nintegration policies.\n* Create an agent policy with a shared integration policy and a\nnon-shared integration policy.\n* Duplicate the agent policy: the duplicated policy should only\nduplicate the non-shared integration policy and the shared integration\npolicy should be reused.\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n### Identify risks\n\nIncorrect package policies in duplicated agent policies.","sha":"5c78ff18484e77b5ec5a4ba2ab341ed65db4f21c","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:Fleet","v9.0.0","backport:version","v9.1.0","v8.19.0"],"title":"[Fleet] Reuse shared integration policies when duplicating agent policies","number":217872,"url":"https://github.com/elastic/kibana/pull/217872","mergeCommit":{"message":"[Fleet] Reuse shared integration policies when duplicating agent policies (#217872)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/215335\n\nCurrently, when an agent policy is duplicated, shared integration\npolicies are also duplicated. This PR adds logic where the duplicated\nagent policy also shares these integration policies.\n\n### Testing\n\n* Run ES with an [Entreprise\nlicense](https://www.elastic.co/subscriptions) to avail of reusable\nintegration policies.\n* Create an agent policy with a shared integration policy and a\nnon-shared integration policy.\n* Duplicate the agent policy: the duplicated policy should only\nduplicate the non-shared integration policy and the shared integration\npolicy should be reused.\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n### Identify risks\n\nIncorrect package policies in duplicated agent policies.","sha":"5c78ff18484e77b5ec5a4ba2ab341ed65db4f21c"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/217872","number":217872,"mergeCommit":{"message":"[Fleet] Reuse shared integration policies when duplicating agent policies (#217872)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/215335\n\nCurrently, when an agent policy is duplicated, shared integration\npolicies are also duplicated. This PR adds logic where the duplicated\nagent policy also shares these integration policies.\n\n### Testing\n\n* Run ES with an [Entreprise\nlicense](https://www.elastic.co/subscriptions) to avail of reusable\nintegration policies.\n* Create an agent policy with a shared integration policy and a\nnon-shared integration policy.\n* Duplicate the agent policy: the duplicated policy should only\nduplicate the non-shared integration policy and the shared integration\npolicy should be reused.\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n### Identify risks\n\nIncorrect package policies in duplicated agent policies.","sha":"5c78ff18484e77b5ec5a4ba2ab341ed65db4f21c"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jill Guyonnet <jill.guyonnet@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
umbopepato
pushed a commit
to umbopepato/kibana
that referenced
this pull request
Apr 14, 2025
…cies (elastic#217872) ## Summary Closes elastic#215335 Currently, when an agent policy is duplicated, shared integration policies are also duplicated. This PR adds logic where the duplicated agent policy also shares these integration policies. ### Testing * Run ES with an [Entreprise license](https://www.elastic.co/subscriptions) to avail of reusable integration policies. * Create an agent policy with a shared integration policy and a non-shared integration policy. * Duplicate the agent policy: the duplicated policy should only duplicate the non-shared integration policy and the shared integration policy should be reused. ### Checklist - [x] [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 - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Incorrect package policies in duplicated agent policies.
Contributor
|
This PR didn't make it into the latest BC. Updating the labels. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #215335
Currently, when an agent policy is duplicated, shared integration policies are also duplicated. This PR adds logic where the duplicated agent policy also shares these integration policies.
Testing
Checklist
release_note:*label is applied per the guidelinesIdentify risks
Incorrect package policies in duplicated agent policies.