Skip to content

Commit

Permalink
change index pattern id to be the same as index pattern title
Browse files Browse the repository at this point in the history
  • Loading branch information
neptunian committed Mar 18, 2020
1 parent 965679a commit b6488e0
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,7 @@ export async function installIndexPatterns(
// if this is an update because a package is being unisntalled (no pkgkey argument passed) and no other packages are installed, remove the index pattern
if (!pkgkey && installedPackages.length === 0) {
try {
await savedObjectsClient.delete(
INDEX_PATTERN_SAVED_OBJECT_TYPE,
`epm-ip-${indexPatternType}`
);
await savedObjectsClient.delete(INDEX_PATTERN_SAVED_OBJECT_TYPE, `${indexPatternType}-*`);
} catch (err) {
// index pattern was probably deleted by the user already
}
Expand All @@ -111,7 +108,7 @@ export async function installIndexPatterns(
const kibanaIndexPattern = createIndexPattern(indexPatternType, fields);
// create or overwrite the index pattern
await savedObjectsClient.create(INDEX_PATTERN_SAVED_OBJECT_TYPE, kibanaIndexPattern, {
id: `epm-ip-${indexPatternType}`,
id: `${indexPatternType}-*`,
overwrite: true,
});
});
Expand Down

0 comments on commit b6488e0

Please sign in to comment.