From 73ff7972f523a533e144cde2d69c436ed62f1b5b Mon Sep 17 00:00:00 2001 From: Julia Bardi <90178898+juliaElastic@users.noreply.github.com> Date: Tue, 22 Aug 2023 18:55:17 +0200 Subject: [PATCH] [Fleet] Fix index patterns being recreated in default space, fix migration version setting (#164456) Closes https://github.com/elastic/kibana/issues/164243 Added a `typeMigrationVersion: '8.0.0'` to index patterns until https://github.com/elastic/kibana/issues/164454 is fixed. Related to https://github.com/elastic/kibana/pull/161969 Feedback from kibana core team, we should always set the migration version fields, even if `migrationVersion` is not set. It would be good to backport this to 8.9 too. How to test locally: - create a test space - install system integration in test space - restart kibana - verify that the index patterns `logs-*`, `metrics-*` are still in test space in Data Views UI - [ ] [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 --- .../fleet/server/services/epm/kibana/index_pattern/install.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/install.ts b/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/install.ts index 1637bf19d8df4..91e603e80aee2 100644 --- a/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/kibana/index_pattern/install.ts @@ -18,6 +18,8 @@ export function getIndexPatternSavedObjects() { return indexPatternTypes.map((indexPatternType) => ({ id: `${indexPatternType}-*`, type: INDEX_PATTERN_SAVED_OBJECT_TYPE, + // workaround until https://github.com/elastic/kibana/issues/164454 is fixed + typeMigrationVersion: '8.0.0', attributes: { title: `${indexPatternType}-*`, timeFieldName: '@timestamp',