File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
x-pack/plugins/event_log/server/es Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const createNamesMock = () => {
1010 const mock : jest . Mocked < EsNames > = {
1111 base : '.kibana' ,
1212 alias : '.kibana-event-log-8.0.0' ,
13- ilmPolicy : '. kibana-event-log-policy' ,
13+ ilmPolicy : 'kibana-event-log-policy' ,
1414 indexPattern : '.kibana-event-log-*' ,
1515 indexPatternWithVersion : '.kibana-event-log-8.0.0-*' ,
1616 initialIndex : '.kibana-event-log-8.0.0-000001' ,
Original file line number Diff line number Diff line change @@ -23,4 +23,10 @@ describe('getEsNames()', () => {
2323 expect ( esNames . initialIndex ) . toEqual ( `${ base } -event-log-${ version } -000001` ) ;
2424 expect ( esNames . indexTemplate ) . toEqual ( `${ base } -event-log-${ version } -template` ) ;
2525 } ) ;
26+
27+ test ( 'ilm policy name does not contain dot prefix' , ( ) => {
28+ const base = '.XYZ' ;
29+ const esNames = getEsNames ( base ) ;
30+ expect ( esNames . ilmPolicy ) . toEqual ( 'XYZ-event-log-policy' ) ;
31+ } ) ;
2632} ) ;
Original file line number Diff line number Diff line change @@ -22,10 +22,13 @@ export interface EsNames {
2222export function getEsNames ( baseName : string ) : EsNames {
2323 const eventLogName = `${ baseName } ${ EVENT_LOG_NAME_SUFFIX } ` ;
2424 const eventLogNameWithVersion = `${ eventLogName } ${ EVENT_LOG_VERSION_SUFFIX } ` ;
25+ const eventLogPolicyName = `${
26+ baseName . startsWith ( '.' ) ? baseName . substring ( 1 ) : baseName
27+ } ${ EVENT_LOG_NAME_SUFFIX } -policy`;
2528 return {
2629 base : baseName ,
2730 alias : eventLogNameWithVersion ,
28- ilmPolicy : `${ eventLogName } -policy ` ,
31+ ilmPolicy : `${ eventLogPolicyName } ` ,
2932 indexPattern : `${ eventLogName } -*` ,
3033 indexPatternWithVersion : `${ eventLogNameWithVersion } -*` ,
3134 initialIndex : `${ eventLogNameWithVersion } -000001` ,
You can’t perform that action at this time.
0 commit comments