[8.6] [Security Solution] Add missed policy migration export (#146481) (#146489)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Security Solution] Add missed policy migration export
(#146481)](https://github.com/elastic/kibana/pull/146481)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Kevin
Logan","email":"56395104+kevinlog@users.noreply.github.com"},"sourceCommit":{"committedDate":"2022-11-29T00:11:17Z","message":"[Security
Solution] Add missed policy migration export (#146481)\n\n##
Summary\r\n\r\nAdds a missing export to the policy migration for
8.6.0\r\n\r\nPR with the migration for
reference:\r\nhttps://github.com/elastic/kibana/pull/146050\r\n\r\n- [x]
[Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"3fa88f289609ae8565e9d6b05d502adcc912b43a","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","Team:Onboarding
and Lifecycle
Mgt","auto-backport","v8.6.0","v8.7.0"],"number":146481,"url":"https://github.com/elastic/kibana/pull/146481","mergeCommit":{"message":"[Security
Solution] Add missed policy migration export (#146481)\n\n##
Summary\r\n\r\nAdds a missing export to the policy migration for
8.6.0\r\n\r\nPR with the migration for
reference:\r\nhttps://github.com/elastic/kibana/pull/146050\r\n\r\n- [x]
[Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"3fa88f289609ae8565e9d6b05d502adcc912b43a"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146481","number":146481,"mergeCommit":{"message":"[Security
Solution] Add missed policy migration export (#146481)\n\n##
Summary\r\n\r\nAdds a missing export to the policy migration for
8.6.0\r\n\r\nPR with the migration for
reference:\r\nhttps://github.com/elastic/kibana/pull/146050\r\n\r\n- [x]
[Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"3fa88f289609ae8565e9d6b05d502adcc912b43a"}}]}]
BACKPORT-->
This commit is contained in:
Kevin Logan 2022-11-28 20:37:36 -05:00 committed by GitHub
parent 6c144c2e1c
commit 1752c8eadf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View file

@ -99,7 +99,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"ingest-agent-policies": "9170cdad95d887c036b87adf0ff38a3f12800c05",
"ingest-download-sources": "1e69dabd6db5e320fe08c5bda8f35f29bafc6b54",
"ingest-outputs": "29b867bf7bfd28b1e17c84697dce5c6d078f9705",
"ingest-package-policies": "e8707a8c7821ea085e67c2d213e24efa56307393",
"ingest-package-policies": "d93048bf153f9043946e8965065a88014f7ccb41",
"ingest_manager_settings": "6f36714825cc15ea8d7cda06fde7851611a532b4",
"inventory-view": "bc2bd1e7ec7c186159447ab228d269f22bd39056",
"kql-telemetry": "29544cd7d3b767c5399878efae6bd724d24c03fd",

View file

@ -47,7 +47,11 @@ import {
migratePackagePolicyToV840,
} from './migrations/to_v8_4_0';
import { migratePackagePolicyToV850, migrateAgentPolicyToV850 } from './migrations/to_v8_5_0';
import { migrateSettingsToV860, migrateInstallationToV860 } from './migrations/to_v8_6_0';
import {
migrateSettingsToV860,
migrateInstallationToV860,
migratePackagePolicyToV860,
} from './migrations/to_v8_6_0';
/*
* Saved object types and mappings
@ -228,6 +232,7 @@ const getSavedObjectTypes = (
'8.3.0': migratePackagePolicyToV830,
'8.4.0': migratePackagePolicyToV840,
'8.5.0': migratePackagePolicyToV850,
'8.6.0': migratePackagePolicyToV860,
},
},
[PACKAGES_SAVED_OBJECT_TYPE]: {

View file

@ -36,7 +36,7 @@ export const migrateInstallationToV860: SavedObjectMigrationFn<Installation, Ins
return installationDoc;
};
export const migratePackagePolicyToV840: SavedObjectMigrationFn<PackagePolicy, PackagePolicy> = (
export const migratePackagePolicyToV860: SavedObjectMigrationFn<PackagePolicy, PackagePolicy> = (
packagePolicyDoc,
migrationContext
) => {