kibana/x-pack/plugins
John Schulz 868ae59c93
[Fleet] Support user overrides in composable templates (#101769)
## Summary
Closes #90454
Closes https://github.com/elastic/kibana/issues/72959

 * Rename the component templates which are [installed for some packages](https://github.com/elastic/kibana/blob/master/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts#L197-L213) from `${templateName}-mappings` and `${templateName}-settings` to `${templateName}@mappings` and `${templateName}@settings`
 * When any package is installed, add a component template named `${templateName}@custom`
 * Any of above templates also include a `_meta` property with `{ package: { name: packageName } }`
 * On package installation, add any installed component templates to the `installed_es` property of the `epm-packages` saved object
 * On package removal, remove any installed component templates from the `installed_es` property of the `epm-packages` saved object

<details><summary>Kibana logs showing component templates added for package</summary>

```
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.file@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.registry@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [.logs-endpoint.diagnostic.collection@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.library@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.security@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.network@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.alerts@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [metrics-endpoint.metrics@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.process@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [metrics-endpoint.policy@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [metrics-endpoint.metadata@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.registry@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [.logs-endpoint.diagnostic.collection@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.security@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.file@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.library@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.network@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.alerts@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [metrics-endpoint.metrics@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [metrics-endpoint.policy@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.process@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [metrics-endpoint.metadata@custom]
```

</details>

<details><summary>screenshot - component templates are editable in the Stack Management UI</summary>
<img width="1342" alt="Screen Shot 2021-06-17 at 4 06 24 PM" src="https://user-images.githubusercontent.com/57655/122465421-1502bb80-cf86-11eb-94f4-9880cb3ea844.png">
</details>


### Checklist

Delete any items that are not applicable to this PR.

- [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials
- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
2021-06-23 06:57:39 -04:00
..
actions Revert "[alerting][actions] add task scheduled date and delay to event log (#102252)" 2021-06-22 21:55:29 -05:00
alerting Revert "[alerting][actions] add task scheduled date and delay to event log (#102252)" 2021-06-22 21:55:29 -05:00
apm [APM] Fix bug when error page is empty (#102940) 2021-06-23 00:12:05 +02:00
banners
canvas [canvas] New Home Page (#102446) 2021-06-22 14:11:15 -05:00
cases [Security Solution] show case names in isolation success message (#102664) 2021-06-22 14:01:24 -04:00
cloud Add xpack.cloud.full_story configuration (#102363) 2021-06-17 10:25:32 -04:00
console_extensions
cross_cluster_replication [CCR] Migrate to new page layout structure (#102507) 2021-06-22 17:47:24 +02:00
dashboard_enhanced
dashboard_mode
data_enhanced Cleanup outdated @elastic/elasticsearch client type errors (#101741) 2021-06-21 10:03:00 -04:00
data_visualizer
discover_enhanced
drilldowns Revert "TS Incremental build exclude test files (#95610)" (#96223) 2021-04-05 11:59:26 -07:00
embeddable_enhanced
encrypted_saved_objects
enterprise_search [App Search] Convert Synonyms page to new page template (#102828) 2021-06-22 19:50:13 -07:00
event_log Revert "[alerting][actions] add task scheduled date and delay to event log (#102252)" 2021-06-22 21:55:29 -05:00
features
file_upload
fleet [Fleet] Support user overrides in composable templates (#101769) 2021-06-23 06:57:39 -04:00
global_search
global_search_bar
global_search_providers
graph
grokdebugger
index_lifecycle_management ILM locators (#102313) 2021-06-21 22:11:12 +02:00
index_management Migrate Index Management to new solutions nav (#101548) 2021-06-22 17:15:57 -07:00
infra Renamed button and dropdown items in headers (apm, logs, metrics and uptime) from alerts to rules (#100918) 2021-06-22 13:15:17 +02:00
ingest_pipelines Ingest pipeline locator (#102878) 2021-06-23 10:23:28 +02:00
lens [Lens] Remove rank direction tooltip (#102886) 2021-06-23 10:27:43 +02:00
license_api_guard
license_management [License management] Migrate to new page layout (#102218) 2021-06-22 09:17:52 +02:00
licensing Display Kibana overall status in the logs and have FTR wait for green status before running tests (#102108) 2021-06-17 10:19:07 -04:00
lists [Security Solution][Endpoint] Don't create event filters list from manifest manager (#102618) 2021-06-22 18:49:34 +02:00
logstash
maps [Maps] clean up feature editing name space to avoid conflicts with layer settings editing (#102516) 2021-06-17 19:52:31 -06:00
metrics_entities
ml Ingest pipeline locator (#102878) 2021-06-23 10:23:28 +02:00
monitoring [Monitoring] Update Kibana rules/alerts language in setup mode (#102441) 2021-06-22 11:21:19 -07:00
observability [Cases] RBAC Bugs (#101325) 2021-06-22 13:52:03 -04:00
osquery [OsQuery] fix usage collector when .fleet indices are empty (#102977) 2021-06-23 11:15:12 +02:00
painless_lab
remote_clusters
reporting
rollup [Rollups] Migrate to new page layout (#102268) 2021-06-22 14:13:48 -04:00
rule_registry Move ES aggregation types to src/core (#102597) 2021-06-21 11:11:15 +01:00
runtime_fields
saved_objects_tagging Converts saved object tagging to new management layout (#102284) 2021-06-17 14:46:30 -04:00
searchprofiler
security Cleanup outdated @elastic/elasticsearch client type errors (#101741) 2021-06-21 10:03:00 -04:00
security_solution [Security Solution][Endpoint] Paginate actions log with infinite scroll (#102261) 2021-06-23 09:19:13 +02:00
snapshot_restore Cleanup outdated @elastic/elasticsearch client type errors (#101741) 2021-06-21 10:03:00 -04:00
spaces
stack_alerts Move ES aggregation types to src/core (#102597) 2021-06-21 11:11:15 +01:00
task_manager Cleanup outdated @elastic/elasticsearch client type errors (#101741) 2021-06-21 10:03:00 -04:00
telemetry_collection_xpack [Asset Management] Osquery telemetry updates (#100754) 2021-06-17 14:53:27 -04:00
timelines [RAC] T-Grid is moving to a new home (#100265) 2021-06-22 18:56:33 -04:00
transform Cleanup outdated @elastic/elasticsearch client type errors (#101741) 2021-06-21 10:03:00 -04:00
translations [Lens] Remove rank direction tooltip (#102886) 2021-06-23 10:27:43 +02:00
triggers_actions_ui Cleanup outdated @elastic/elasticsearch client type errors (#101741) 2021-06-21 10:03:00 -04:00
ui_actions_enhanced
upgrade_assistant
uptime [Uptime] Refactor cert alerts from batched to individual (#102138) 2021-06-22 20:56:43 -04:00
watcher
xpack_legacy