Skip to content

Commit

Permalink
[Fleet] Fix index patterns being recreated in default space, fix migr…
Browse files Browse the repository at this point in the history
…ation version setting (#164456)

## Summary

Closes #164243
Added a `typeMigrationVersion: '8.0.0'` to index patterns until
#164454 is fixed.

Related to #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

### Checklist

- [ ] [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
  • Loading branch information
juliaElastic authored Aug 22, 2023
1 parent db4ffd0 commit 433d4f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,12 @@ export function createSavedObjectKibanaAsset(asset: ArchiveAsset): SavedObjectTo

if (asset.migrationVersion) {
so.migrationVersion = asset.migrationVersion;
} else {
if (asset.coreMigrationVersion) {
so.coreMigrationVersion = asset.coreMigrationVersion;
}
if (asset.typeMigrationVersion) {
so.typeMigrationVersion = asset.typeMigrationVersion;
}
}
if (asset.coreMigrationVersion) {
so.coreMigrationVersion = asset.coreMigrationVersion;
}
if (asset.typeMigrationVersion) {
so.typeMigrationVersion = asset.typeMigrationVersion;
}
return so as SavedObjectToBe;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 433d4f2

Please sign in to comment.