Skip to content

Commit

Permalink
[Ingest Manager] stop creating events-* index pattern and placeholder…
Browse files Browse the repository at this point in the history
… index (#74683) (#74720)

* stop creating events-* index pattern and indices

* add integration test to check for placeholder indices
  • Loading branch information
neptunian authored Aug 11, 2020
1 parent 2ea01d3 commit d02d87b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export interface IndexPatternField {
export enum IndexPatternType {
logs = 'logs',
metrics = 'metrics',
events = 'events',
}
// TODO: use a function overload and make pkgName and pkgVersion required for install/update
// and not for an update removal. or separate out the functions
Expand Down Expand Up @@ -111,11 +110,7 @@ export async function installIndexPatterns(
const installedPackagesInfo = await Promise.all(installedPackagesFetchInfoPromise);

// for each index pattern type, create an index pattern
const indexPatternTypes = [
IndexPatternType.logs,
IndexPatternType.metrics,
IndexPatternType.events,
];
const indexPatternTypes = [IndexPatternType.logs, IndexPatternType.metrics];
indexPatternTypes.forEach(async (indexPatternType) => {
// 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 (!pkgName && installedPackages.length === 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ export default function (providerContext: FtrProviderContext) {
id: 'metrics-*',
});
expect(resIndexPatternMetrics.id).equal('metrics-*');
const resIndexPatternEvents = await kibanaServer.savedObjects.get({
type: 'index-pattern',
id: 'events-*',
});
expect(resIndexPatternEvents.id).equal('events-*');
const resDashboard = await kibanaServer.savedObjects.get({
type: 'dashboard',
id: 'sample_dashboard',
Expand All @@ -108,6 +103,18 @@ export default function (providerContext: FtrProviderContext) {
});
expect(resSearch.id).equal('sample_search');
});
it('should have installed placeholder indices', async function () {
const resLogsIndexPatternPlaceholder = await es.transport.request({
method: 'GET',
path: `/logs-index_pattern_placeholder`,
});
expect(resLogsIndexPatternPlaceholder.statusCode).equal(200);
const resMetricsIndexPatternPlaceholder = await es.transport.request({
method: 'GET',
path: `/metrics-index_pattern_placeholder`,
});
expect(resMetricsIndexPatternPlaceholder.statusCode).equal(200);
});
it('should have created the correct saved object', async function () {
const res = await kibanaServer.savedObjects.get({
type: 'epm-packages',
Expand Down

0 comments on commit d02d87b

Please sign in to comment.