File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed
x-pack/plugins/fleet/server/services/epm/elasticsearch/template Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,31 @@ test('adds empty composed_of correctly', () => {
6060 expect ( template . composed_of ) . toStrictEqual ( composedOfTemplates ) ;
6161} ) ;
6262
63+ test ( 'adds hidden field correctly' , ( ) => {
64+ const templateWithHiddenName = 'logs-nginx-access-abcd' ;
65+
66+ const templateWithHidden = getTemplate ( {
67+ type : 'logs' ,
68+ templateWithHiddenName,
69+ packageName : 'nginx' ,
70+ mappings : { properties : { } } ,
71+ composedOfTemplates : [ ] ,
72+ hidden : true ,
73+ } ) ;
74+ expect ( templateWithHidden . data_stream . hidden . toStrictEqual ( true ) ) ;
75+
76+ const templateWithoutHiddenName = 'logs-nginx-access-efgh' ;
77+
78+ const template = getTemplate ( {
79+ type : 'logs' ,
80+ templateWithoutHiddenName,
81+ packageName : 'nginx' ,
82+ mappings : { properties : { } } ,
83+ composedOfTemplates : [ ] ,
84+ } ) ;
85+ expect ( template . data_stream . hidden . toStrictEqual ( false ) ) ;
86+ } ) ;
87+
6388test ( 'tests loading base.yml' , ( ) => {
6489 const ymlPath = path . join ( __dirname , '../../fields/tests/base.yml' ) ;
6590 const fieldsYML = readFileSync ( ymlPath , 'utf-8' ) ;
Original file line number Diff line number Diff line change @@ -263,7 +263,6 @@ function getBaseTemplate(
263263 mappings : IndexTemplateMappings ,
264264 packageName : string ,
265265 composedOfTemplates : string [ ] ,
266- ilmPolicy ?: string | undefined ,
267266 hidden ?: boolean | false
268267) : IndexTemplate {
269268 // Meta information to identify Ingest Manager's managed templates and indices
@@ -288,7 +287,7 @@ function getBaseTemplate(
288287 index : {
289288 // ILM Policy must be added here, for now point to the default global ILM policy name
290289 lifecycle : {
291- name : ilmPolicy ? ilmPolicy : type ,
290+ name : type ,
292291 } ,
293292 // What should be our default for the compression?
294293 codec : 'best_compression' ,
You can’t perform that action at this time.
0 commit comments