Renamed ilm policy for event log so it is not prefixed with dot (#64262)
* Renamed ilm policy for event log so it is not prefixed with dot * Fixed due to comments
This commit is contained in:
parent
feed406c77
commit
f520bbd754
3 changed files with 11 additions and 2 deletions
|
@ -10,7 +10,7 @@ const createNamesMock = () => {
|
|||
const mock: jest.Mocked<EsNames> = {
|
||||
base: '.kibana',
|
||||
alias: '.kibana-event-log-8.0.0',
|
||||
ilmPolicy: '.kibana-event-log-policy',
|
||||
ilmPolicy: 'kibana-event-log-policy',
|
||||
indexPattern: '.kibana-event-log-*',
|
||||
indexPatternWithVersion: '.kibana-event-log-8.0.0-*',
|
||||
initialIndex: '.kibana-event-log-8.0.0-000001',
|
||||
|
|
|
@ -23,4 +23,10 @@ describe('getEsNames()', () => {
|
|||
expect(esNames.initialIndex).toEqual(`${base}-event-log-${version}-000001`);
|
||||
expect(esNames.indexTemplate).toEqual(`${base}-event-log-${version}-template`);
|
||||
});
|
||||
|
||||
test('ilm policy name does not contain dot prefix', () => {
|
||||
const base = '.XYZ';
|
||||
const esNames = getEsNames(base);
|
||||
expect(esNames.ilmPolicy).toEqual('XYZ-event-log-policy');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -22,10 +22,13 @@ export interface EsNames {
|
|||
export function getEsNames(baseName: string): EsNames {
|
||||
const eventLogName = `${baseName}${EVENT_LOG_NAME_SUFFIX}`;
|
||||
const eventLogNameWithVersion = `${eventLogName}${EVENT_LOG_VERSION_SUFFIX}`;
|
||||
const eventLogPolicyName = `${
|
||||
baseName.startsWith('.') ? baseName.substring(1) : baseName
|
||||
}${EVENT_LOG_NAME_SUFFIX}-policy`;
|
||||
return {
|
||||
base: baseName,
|
||||
alias: eventLogNameWithVersion,
|
||||
ilmPolicy: `${eventLogName}-policy`,
|
||||
ilmPolicy: `${eventLogPolicyName}`,
|
||||
indexPattern: `${eventLogName}-*`,
|
||||
indexPatternWithVersion: `${eventLogNameWithVersion}-*`,
|
||||
initialIndex: `${eventLogNameWithVersion}-000001`,
|
||||
|
|
Loading…
Reference in a new issue