-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Rollups] Disable Rollups index data enricher if Rollups UI is disabl…
…ed (#167295) ## Summary Fixes #167231 This PR introduces following changes, if the config `xpack.rollup.ui.enabled` is set to `false`: - on the client side: - don't add the Rollup toggle to Index Management - don't add the Rollup badge to Index Management - on the server side: - don't add Rollup data enricher to Index Management - don't enable Rollup in data views and data search (the same is done on the client side already)
- Loading branch information
Showing
6 changed files
with
121 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...k/test/api_integration/apis/management/index_management/disabled_data_enrichers/config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { FtrConfigProviderContext } from '@kbn/test'; | ||
|
||
export default async function ({ readConfigFile }: FtrConfigProviderContext) { | ||
const functionalConfig = await readConfigFile(require.resolve('../../config.ts')); | ||
|
||
return { | ||
...functionalConfig.getAll(), | ||
testFiles: [require.resolve('.')], | ||
kbnTestServer: { | ||
...functionalConfig.get('kbnTestServer'), | ||
serverArgs: [ | ||
...functionalConfig.get('kbnTestServer.serverArgs'), | ||
// disable the UIs of plugins that add index data enrichers | ||
`--xpack.rollup.ui.enabled=false`, | ||
`--xpack.ccr.ui.enabled=false`, | ||
`--xpack.ilm.ui.enabled=false`, | ||
], | ||
}, | ||
}; | ||
} |
14 changes: 14 additions & 0 deletions
14
...ck/test/api_integration/apis/management/index_management/disabled_data_enrichers/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../../../ftr_provider_context'; | ||
|
||
export default ({ loadTestFile }: FtrProviderContext) => { | ||
describe('Index Management: disabled data enrichers', function () { | ||
loadTestFile(require.resolve('./indices')); | ||
}); | ||
}; |
50 changes: 50 additions & 0 deletions
50
.../test/api_integration/apis/management/index_management/disabled_data_enrichers/indices.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { API_BASE_PATH, Index } from '@kbn/index-management-plugin/common'; | ||
import { FtrProviderContext } from '../../../../ftr_provider_context'; | ||
import { sortedExpectedIndexKeys } from '../constants'; | ||
|
||
export default function ({ getService }: FtrProviderContext) { | ||
const supertest = getService('supertest'); | ||
const es = getService('es'); | ||
const esDeleteAllIndices = getService('esDeleteAllIndices'); | ||
const createIndex = async (name: string) => { | ||
await es.indices.create({ index: name }); | ||
}; | ||
|
||
const testIndex = 'test_index'; | ||
describe('GET indices without data enrichers', async () => { | ||
before(async () => { | ||
await createIndex(testIndex); | ||
}); | ||
after(async () => { | ||
await esDeleteAllIndices([testIndex]); | ||
}); | ||
|
||
it(`doesn't send ILM, CCR and Rollups requests`, async () => { | ||
const { body: indices } = await supertest | ||
.get(`${API_BASE_PATH}/indices`) | ||
.set('kbn-xsrf', 'xxx') | ||
.expect(200); | ||
|
||
const index = indices.find((item: Index) => item.name === testIndex); | ||
|
||
const sortedReceivedKeys = Object.keys(index).sort(); | ||
|
||
let expectedKeys = [...sortedExpectedIndexKeys]; | ||
// no CCR data enricher | ||
expectedKeys = expectedKeys.filter((item) => item !== 'isFollowerIndex'); | ||
// no ILM data enricher | ||
expectedKeys = expectedKeys.filter((item) => item !== 'ilm'); | ||
// no Rollups data enricher | ||
expectedKeys = expectedKeys.filter((item) => item !== 'isRollupIndex'); | ||
expect(sortedReceivedKeys).to.eql(expectedKeys); | ||
}); | ||
}); | ||
} |