[Ingest Manager] stop creating events-* index pattern and placeholder index (#74683)
* stop creating events-* index pattern and indices * add integration test to check for placeholder indices
This commit is contained in:
parent
697cd6412e
commit
543109b601
|
@ -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
|
||||
|
@ -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) {
|
||||
|
|
|
@ -85,11 +85,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',
|
||||
|
@ -111,6 +106,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',
|
||||
|
|
Loading…
Reference in a new issue