Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed ilm policy for event log so it is not prefixed with dot #64262

Merged
merged 3 commits into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion x-pack/plugins/event_log/server/es/names.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 6 additions & 0 deletions x-pack/plugins/event_log/server/es/names.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
5 changes: 4 additions & 1 deletion x-pack/plugins/event_log/server/es/names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down