Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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