From 6d955fc101966179e0a43ab254939788e716c748 Mon Sep 17 00:00:00 2001 From: John Schulz Date: Wed, 4 Dec 2019 10:29:40 -0500 Subject: [PATCH 1/8] Move cache 'hack' into getAssetsData --- .../epm/server/lib/elasticsearch/template/install.ts | 9 +-------- x-pack/legacy/plugins/epm/server/packages/assets.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/install.ts b/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/install.ts index de48c999514c17..170699a3a6841b 100644 --- a/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/install.ts +++ b/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/install.ts @@ -6,7 +6,6 @@ import { safeLoad } from 'js-yaml'; import { RegistryPackage, Dataset, AssetReference } from '../../../../common/types'; -import * as Registry from '../../../registry'; import { CallESAsCurrentUser } from '../../../../server/lib/cluster_access'; import { getAssetsData } from '../../../packages/assets'; import { Field } from '../../fields/field'; @@ -22,19 +21,13 @@ const isFields = (path: string) => { * For each dataset, the fields.yml files are extracted. If there are multiple * in one datasets, they are merged together into 1 and then converted to a template * The template is currently loaded with the pkgey-package-dataset - * @param callCluster - * @param pkgkey */ export async function installTemplates(p: RegistryPackage, callCluster: CallESAsCurrentUser) { - const pkgkey = p.name + '-' + p.version; - // TODO: Needs to be called to fill the cache but should not be required - await Registry.getArchiveInfo(pkgkey); - const promises: Array> = []; for (const dataset of p.datasets) { // Fetch all assset entries for this dataset - const assetEntries = getAssetsData(p, isFields, dataset.name); + const assetEntries = await getAssetsData(p, isFields, dataset.name); // Merge all the fields of a dataset together and create an Elasticsearch index template let datasetFields: Field[] = []; diff --git a/x-pack/legacy/plugins/epm/server/packages/assets.ts b/x-pack/legacy/plugins/epm/server/packages/assets.ts index 05f0c4b47b09e4..81b05373c9cbae 100644 --- a/x-pack/legacy/plugins/epm/server/packages/assets.ts +++ b/x-pack/legacy/plugins/epm/server/packages/assets.ts @@ -5,6 +5,7 @@ */ import * as Registry from '../registry'; +import { cacheHas } from '../registry/cache'; import { RegistryPackage } from '../../common/types'; export function getAssets( @@ -40,11 +41,15 @@ export function getAssets( return assets; } -export function getAssetsData( +export async function getAssetsData( packageInfo: RegistryPackage, filter = (path: string): boolean => true, dataSet: string = '' -): Registry.ArchiveEntry[] { +): Promise { + // TODO: Needs to be called to fill the cache but should not be required + const pkgkey = packageInfo.name + '-' + packageInfo.version; + if (!cacheHas(pkgkey)) await Registry.getArchiveInfo(pkgkey); + // Gather all asset data const assets = getAssets(packageInfo, filter, dataSet); From 118b2ca97beebc4e25d45fea806b0a9774540f8c Mon Sep 17 00:00:00 2001 From: John Schulz Date: Wed, 4 Dec 2019 10:33:44 -0500 Subject: [PATCH 2/8] p -> pkg. package is reserved. pkgkey is used in many places --- .../server/lib/elasticsearch/template/install.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/install.ts b/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/install.ts index 170699a3a6841b..9def9fd6110319 100644 --- a/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/install.ts +++ b/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/install.ts @@ -22,12 +22,12 @@ const isFields = (path: string) => { * in one datasets, they are merged together into 1 and then converted to a template * The template is currently loaded with the pkgey-package-dataset */ -export async function installTemplates(p: RegistryPackage, callCluster: CallESAsCurrentUser) { +export async function installTemplates(pkg: RegistryPackage, callCluster: CallESAsCurrentUser) { const promises: Array> = []; - for (const dataset of p.datasets) { + for (const dataset of pkg.datasets) { // Fetch all assset entries for this dataset - const assetEntries = await getAssetsData(p, isFields, dataset.name); + const assetEntries = await getAssetsData(pkg, isFields, dataset.name); // Merge all the fields of a dataset together and create an Elasticsearch index template let datasetFields: Field[] = []; @@ -38,7 +38,7 @@ export async function installTemplates(p: RegistryPackage, callCluster: CallESAs } } - const promise = installTemplate({ callCluster, fields: datasetFields, p, dataset }); + const promise = installTemplate({ callCluster, fields: datasetFields, pkg, dataset }); promises.push(promise); } @@ -48,16 +48,16 @@ export async function installTemplates(p: RegistryPackage, callCluster: CallESAs async function installTemplate({ callCluster, fields, - p, + pkg, dataset, }: { callCluster: CallESAsCurrentUser; fields: Field[]; - p: RegistryPackage; + pkg: RegistryPackage; dataset: Dataset; }): Promise { const mappings = generateMappings(fields); - const templateName = generateTemplateName(p.name, dataset.name, dataset.type); + const templateName = generateTemplateName(pkg.name, dataset.name, dataset.type); const template = getTemplate(templateName + '-*', mappings); // TODO: Check return values for errors await callCluster('indices.putTemplate', { From 4e4a28568e42da1a3616327844e3f76bfda7bb3a Mon Sep 17 00:00:00 2001 From: John Schulz Date: Wed, 4 Dec 2019 10:51:26 -0500 Subject: [PATCH 3/8] Remove unnecessary type cast --- x-pack/legacy/plugins/epm/server/datasources/create.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/epm/server/datasources/create.ts b/x-pack/legacy/plugins/epm/server/datasources/create.ts index 4befeff6b49cd7..31146ba8500c89 100644 --- a/x-pack/legacy/plugins/epm/server/datasources/create.ts +++ b/x-pack/legacy/plugins/epm/server/datasources/create.ts @@ -77,7 +77,7 @@ function createFakeDatasource(pkgkey: string, assets: Asset[] = []): Datasource version: '1.0.1, 1.3.1', description: 'description', title: 'title', - assets: assets as Asset[], + assets, }, streams: [ { From d527dbd2f1967051179ee737fbbe0a20b67a3025 Mon Sep 17 00:00:00 2001 From: John Schulz Date: Wed, 4 Dec 2019 11:19:57 -0500 Subject: [PATCH 4/8] Clarify reasons behind asset path manipulation --- .../plugins/epm/server/packages/assets.ts | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/x-pack/legacy/plugins/epm/server/packages/assets.ts b/x-pack/legacy/plugins/epm/server/packages/assets.ts index 81b05373c9cbae..8ae76de788de35 100644 --- a/x-pack/legacy/plugins/epm/server/packages/assets.ts +++ b/x-pack/legacy/plugins/epm/server/packages/assets.ts @@ -8,6 +8,11 @@ import * as Registry from '../registry'; import { cacheHas } from '../registry/cache'; import { RegistryPackage } from '../../common/types'; +// paths from RegistryPackage are routes to the assets on EPR +// paths for ArchiveEntry are routes to the assets in the archive +// RegistryPackage paths have a `/package/` prefix compared to ArchiveEntry paths +const EPR_PATH_PREFIX = '/package/'; + export function getAssets( packageInfo: RegistryPackage, filter = (path: string): boolean => true, @@ -25,7 +30,7 @@ export function getAssets( if (dataSet !== '') { // TODO: Filter for dataset path const comparePath = - '/package/' + packageInfo.name + '-' + packageInfo.version + '/dataset/' + dataSet; + EPR_PATH_PREFIX + packageInfo.name + '-' + packageInfo.version + '/dataset/' + dataSet; if (!path.includes(comparePath)) { continue; } @@ -52,19 +57,12 @@ export async function getAssetsData( // Gather all asset data const assets = getAssets(packageInfo, filter, dataSet); + const entries: Registry.ArchiveEntry[] = assets.map(path => { + const archivePath = path.replace(EPR_PATH_PREFIX, ''); + const buffer = Registry.getAsset(archivePath); - const entries: Registry.ArchiveEntry[] = []; - - for (const asset of assets) { - const subPath = asset.substring(9); - const buf = Registry.getAsset(subPath); - - const entry: Registry.ArchiveEntry = { - path: asset, - buffer: buf, - }; - entries.push(entry); - } + return { path, buffer }; + }); return entries; } From c8e7b08e8ce1d6fd19e04600a0b55bbbbf9294bf Mon Sep 17 00:00:00 2001 From: John Schulz Date: Wed, 4 Dec 2019 11:28:51 -0500 Subject: [PATCH 5/8] Return the Datasource; not the Saved Object. --- .../plugins/epm/server/datasources/create.ts | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/x-pack/legacy/plugins/epm/server/datasources/create.ts b/x-pack/legacy/plugins/epm/server/datasources/create.ts index 31146ba8500c89..312d8922ca0e2b 100644 --- a/x-pack/legacy/plugins/epm/server/datasources/create.ts +++ b/x-pack/legacy/plugins/epm/server/datasources/create.ts @@ -33,21 +33,21 @@ export async function createDatasource(options: { return toSave; } -export async function saveDatasourceReferences(options: { +async function saveDatasourceReferences(options: { savedObjectsClient: SavedObjectsClientContract; pkgkey: string; toSave: AssetReference[]; }) { const { savedObjectsClient, pkgkey, toSave } = options; - const savedObject = await getDatasourceObject({ savedObjectsClient, pkgkey }); - const savedRefs = savedObject?.attributes.package.assets; - const mergeRefsReducer = (current: Asset[] = [], pending: Asset) => { - const hasRef = current.find(c => c.id === pending.id && c.type === pending.type); - if (!hasRef) current.push(pending); + const savedDatasource = await getDatasource({ savedObjectsClient, pkgkey }); + const savedAssets = savedDatasource?.package.assets; + const assetsReducer = (current: Asset[] = [], pending: Asset) => { + const hasAsset = current.find(c => c.id === pending.id && c.type === pending.type); + if (!hasAsset) current.push(pending); return current; }; - const toInstall = (toSave as Asset[]).reduce(mergeRefsReducer, savedRefs); + const toInstall = (toSave as Asset[]).reduce(assetsReducer, savedAssets); const datasource: Datasource = createFakeDatasource(pkgkey, toInstall); await savedObjectsClient.create(SAVED_OBJECT_TYPE_DATASOURCES, datasource, { id: pkgkey, @@ -57,14 +57,16 @@ export async function saveDatasourceReferences(options: { return toInstall; } -export async function getDatasourceObject(options: { +async function getDatasource(options: { savedObjectsClient: SavedObjectsClientContract; pkgkey: string; }) { const { savedObjectsClient, pkgkey } = options; - return savedObjectsClient + const datasource = await savedObjectsClient .get(SAVED_OBJECT_TYPE_DATASOURCES, pkgkey) .catch(e => undefined); + + return datasource?.attributes; } function createFakeDatasource(pkgkey: string, assets: Asset[] = []): Datasource { From 4ca68a5ac894fcb2073d67fa2adcb7a3d94ef186 Mon Sep 17 00:00:00 2001 From: John Schulz Date: Wed, 4 Dec 2019 12:02:07 -0500 Subject: [PATCH 6/8] Use real values from package in fake datasource SO --- .../plugins/epm/server/datasources/create.ts | 49 ++++++++++--------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/x-pack/legacy/plugins/epm/server/datasources/create.ts b/x-pack/legacy/plugins/epm/server/datasources/create.ts index 312d8922ca0e2b..a336a92d98808f 100644 --- a/x-pack/legacy/plugins/epm/server/datasources/create.ts +++ b/x-pack/legacy/plugins/epm/server/datasources/create.ts @@ -8,11 +8,13 @@ import { SavedObjectsClientContract } from 'src/core/server/'; import { CallESAsCurrentUser } from '../lib/cluster_access'; import { installPipelines } from '../lib/elasticsearch/ingest_pipeline/ingest_pipelines'; import { installTemplates } from '../lib/elasticsearch/template/install'; -import { AssetReference } from '../../common/types'; +import { AssetReference, RegistryPackage } from '../../common/types'; import { SAVED_OBJECT_TYPE_DATASOURCES } from '../../common/constants'; import { Datasource, Asset, InputType } from '../../../ingest/server/libs/types'; import * as Registry from '../registry'; +const pkgToPkgKey = ({ name, version }: RegistryPackage) => `${name}-${version}`; + export async function createDatasource(options: { savedObjectsClient: SavedObjectsClientContract; pkgkey: string; @@ -21,25 +23,26 @@ export async function createDatasource(options: { const { savedObjectsClient, pkgkey, callCluster } = options; const toSave = await installPipelines({ pkgkey, callCluster }); // TODO: Clean up - const info = await Registry.fetchInfo(pkgkey); - await installTemplates(info, callCluster); - - await saveDatasourceReferences({ - savedObjectsClient, - pkgkey, - toSave, - }); + const pkg = await Registry.fetchInfo(pkgkey); + await Promise.all([ + installTemplates(pkg, callCluster), + saveDatasourceReferences({ + savedObjectsClient, + pkg, + toSave, + }), + ]); return toSave; } async function saveDatasourceReferences(options: { savedObjectsClient: SavedObjectsClientContract; - pkgkey: string; + pkg: RegistryPackage; toSave: AssetReference[]; }) { - const { savedObjectsClient, pkgkey, toSave } = options; - const savedDatasource = await getDatasource({ savedObjectsClient, pkgkey }); + const { savedObjectsClient, pkg, toSave } = options; + const savedDatasource = await getDatasource({ savedObjectsClient, pkg }); const savedAssets = savedDatasource?.package.assets; const assetsReducer = (current: Asset[] = [], pending: Asset) => { const hasAsset = current.find(c => c.id === pending.id && c.type === pending.type); @@ -48,9 +51,9 @@ async function saveDatasourceReferences(options: { }; const toInstall = (toSave as Asset[]).reduce(assetsReducer, savedAssets); - const datasource: Datasource = createFakeDatasource(pkgkey, toInstall); + const datasource: Datasource = createFakeDatasource(pkg, toInstall); await savedObjectsClient.create(SAVED_OBJECT_TYPE_DATASOURCES, datasource, { - id: pkgkey, + id: pkgToPkgKey(pkg), overwrite: true, }); @@ -59,26 +62,26 @@ async function saveDatasourceReferences(options: { async function getDatasource(options: { savedObjectsClient: SavedObjectsClientContract; - pkgkey: string; + pkg: RegistryPackage; }) { - const { savedObjectsClient, pkgkey } = options; + const { savedObjectsClient, pkg } = options; const datasource = await savedObjectsClient - .get(SAVED_OBJECT_TYPE_DATASOURCES, pkgkey) + .get(SAVED_OBJECT_TYPE_DATASOURCES, pkgToPkgKey(pkg)) .catch(e => undefined); return datasource?.attributes; } -function createFakeDatasource(pkgkey: string, assets: Asset[] = []): Datasource { +function createFakeDatasource(pkg: RegistryPackage, assets: Asset[] = []): Datasource { return { - id: pkgkey, + id: pkgToPkgKey(pkg), name: 'name', read_alias: 'read_alias', package: { - name: 'name', - version: '1.0.1, 1.3.1', - description: 'description', - title: 'title', + name: pkg.name, + version: pkg.version, + description: pkg.description, + title: pkg.title, assets, }, streams: [ From 09523d260d54c004ce1b3e0650ac25f194df1e69 Mon Sep 17 00:00:00 2001 From: John Schulz Date: Wed, 4 Dec 2019 14:28:32 -0500 Subject: [PATCH 7/8] Error if /datasource/install before /package/install ``` > curl --user elastic:changeme localhost:5601/api/epm/datasource/install/coredns-1.0.1 { "statusCode": 403, "error": "Forbidden", "message": "coredns-1.0.1 is not installed" } > curl --user elastic:changeme localhost:5601/api/epm/install/coredns-1.0.1 [ { "id": "53aa1f70-443e-11e9-8548-ab7fbe04f038", "type": "dashboard" }, { "id": "Metricbeat-CoreDNS-Dashboard-ecs", "type": "dashboard" }, { "id": "75743f70-443c-11e9-8548-ab7fbe04f038", "type": "visualization" }, { "id": "36e08510-53c4-11e9-b466-9be470bbd327-ecs", "type": "visualization" }, { "id": "277fc650-67a9-11e9-a534-715561d0bf42", "type": "visualization" }, { "id": "cfde7fb0-443d-11e9-8548-ab7fbe04f038", "type": "visualization" }, { "id": "a19df590-53c4-11e9-b466-9be470bbd327-ecs", "type": "visualization" }, { "id": "a58345f0-7298-11e9-b0d0-414c3011ddbb", "type": "visualization" }, { "id": "9dc640e0-4432-11e9-8548-ab7fbe04f038", "type": "visualization" }, { "id": "3ad75810-4429-11e9-8548-ab7fbe04f038", "type": "visualization" }, { "id": "57c74300-7308-11e9-b0d0-414c3011ddbb", "type": "visualization" }, { "id": "27da53f0-53d5-11e9-b466-9be470bbd327-ecs", "type": "visualization" }, { "id": "86177430-728d-11e9-b0d0-414c3011ddbb", "type": "visualization" }, { "id": "4804eaa0-7315-11e9-b0d0-414c3011ddbb", "type": "visualization" } ] > curl --user elastic:changeme localhost:5601/api/epm/datasource/install/coredns-1.0.1 [ { "id": "coredns_1_0_1_dataset_log_elasticsearch_ingest_pipeline_pipeline_plaintext_json", "type": "ingest-pipeline" }, { "id": "coredns_1_0_1_dataset_log_elasticsearch_ingest_pipeline_pipeline_json_json", "type": "ingest-pipeline" }, { "id": "coredns_1_0_1_dataset_log_elasticsearch_ingest_pipeline_pipeline_entry_json", "type": "ingest-pipeline" } ] ``` --- .../plugins/epm/server/datasources/create.ts | 15 +++++++++++- .../epm/server/datasources/handlers.ts | 24 ++++++++++++++----- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/x-pack/legacy/plugins/epm/server/datasources/create.ts b/x-pack/legacy/plugins/epm/server/datasources/create.ts index a336a92d98808f..ddbe55ad790319 100644 --- a/x-pack/legacy/plugins/epm/server/datasources/create.ts +++ b/x-pack/legacy/plugins/epm/server/datasources/create.ts @@ -8,12 +8,18 @@ import { SavedObjectsClientContract } from 'src/core/server/'; import { CallESAsCurrentUser } from '../lib/cluster_access'; import { installPipelines } from '../lib/elasticsearch/ingest_pipeline/ingest_pipelines'; import { installTemplates } from '../lib/elasticsearch/template/install'; -import { AssetReference, RegistryPackage } from '../../common/types'; +import { AssetReference, InstallationStatus, RegistryPackage } from '../../common/types'; import { SAVED_OBJECT_TYPE_DATASOURCES } from '../../common/constants'; import { Datasource, Asset, InputType } from '../../../ingest/server/libs/types'; +import { getPackageInfo } from '../packages'; import * as Registry from '../registry'; const pkgToPkgKey = ({ name, version }: RegistryPackage) => `${name}-${version}`; +export class PackageNotInstalledError extends Error { + constructor(pkgkey: string) { + super(`${pkgkey} is not installed`); + } +} export async function createDatasource(options: { savedObjectsClient: SavedObjectsClientContract; @@ -21,9 +27,16 @@ export async function createDatasource(options: { callCluster: CallESAsCurrentUser; }) { const { savedObjectsClient, pkgkey, callCluster } = options; + const info = await getPackageInfo({ savedObjectsClient, pkgkey }); + + if (info.status !== InstallationStatus.installed) { + throw new PackageNotInstalledError(pkgkey); + } + const toSave = await installPipelines({ pkgkey, callCluster }); // TODO: Clean up const pkg = await Registry.fetchInfo(pkgkey); + await Promise.all([ installTemplates(pkg, callCluster), saveDatasourceReferences({ diff --git a/x-pack/legacy/plugins/epm/server/datasources/handlers.ts b/x-pack/legacy/plugins/epm/server/datasources/handlers.ts index d1c39a95ce0d46..2ca27d433eb503 100644 --- a/x-pack/legacy/plugins/epm/server/datasources/handlers.ts +++ b/x-pack/legacy/plugins/epm/server/datasources/handlers.ts @@ -4,7 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { createDatasource } from './index'; +import Boom from 'boom'; +import { createDatasource, PackageNotInstalledError } from './index'; import { PluginContext } from '../plugin'; import { Request, ResponseToolkit } from '../types'; import { getClient } from '../saved_objects'; @@ -25,9 +26,20 @@ export async function handleRequestInstallDatasource(req: CreateDatasourceReques const { pkgkey } = req.params; const savedObjectsClient = getClient(req); const callCluster = getClusterAccessor(extra.context.esClient, req); - return createDatasource({ - savedObjectsClient, - pkgkey, - callCluster, - }); + + try { + const result = await createDatasource({ + savedObjectsClient, + pkgkey, + callCluster, + }); + + return result; + } catch (error) { + if (error instanceof PackageNotInstalledError) { + throw new Boom(error, { statusCode: 403 }); + } else { + return error; + } + } } From ac4d54d0525020b58fbb33bc577391e68637a527 Mon Sep 17 00:00:00 2001 From: ruflin Date: Thu, 5 Dec 2019 11:39:01 +0100 Subject: [PATCH 8/8] fix duplicated imports --- x-pack/legacy/plugins/epm/server/datasources/create.ts | 3 --- x-pack/legacy/plugins/epm/server/datasources/handlers.ts | 1 - .../plugins/epm/server/lib/elasticsearch/template/install.ts | 1 - 3 files changed, 5 deletions(-) diff --git a/x-pack/legacy/plugins/epm/server/datasources/create.ts b/x-pack/legacy/plugins/epm/server/datasources/create.ts index af04487e024f17..18b0920249c478 100644 --- a/x-pack/legacy/plugins/epm/server/datasources/create.ts +++ b/x-pack/legacy/plugins/epm/server/datasources/create.ts @@ -7,13 +7,10 @@ import { SavedObjectsClientContract } from 'src/core/server/'; import { Asset, Datasource, InputType } from '../../../ingest/server/libs/types'; import { SAVED_OBJECT_TYPE_DATASOURCES } from '../../common/constants'; -import { AssetReference } from '../../common/types'; import { CallESAsCurrentUser } from '../lib/cluster_access'; import { installPipelines } from '../lib/elasticsearch/ingest_pipeline/ingest_pipelines'; import { installTemplates } from '../lib/elasticsearch/template/install'; import { AssetReference, InstallationStatus, RegistryPackage } from '../../common/types'; -import { SAVED_OBJECT_TYPE_DATASOURCES } from '../../common/constants'; -import { Datasource, Asset, InputType } from '../../../ingest/server/libs/types'; import { getPackageInfo } from '../packages'; import * as Registry from '../registry'; diff --git a/x-pack/legacy/plugins/epm/server/datasources/handlers.ts b/x-pack/legacy/plugins/epm/server/datasources/handlers.ts index bfeeace13a23af..f060d852edc1b7 100644 --- a/x-pack/legacy/plugins/epm/server/datasources/handlers.ts +++ b/x-pack/legacy/plugins/epm/server/datasources/handlers.ts @@ -10,7 +10,6 @@ import { getClusterAccessor } from '../lib/cluster_access'; import { PluginContext } from '../plugin'; import { getClient } from '../saved_objects'; import { Request, ResponseToolkit } from '../types'; -import { createDatasource } from './index'; // TODO: duplicated from packages/handlers.ts. unduplicate. interface Extra extends ResponseToolkit { diff --git a/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/install.ts b/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/install.ts index 2ae6047d61101f..4c86da805e8654 100644 --- a/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/install.ts +++ b/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/install.ts @@ -8,7 +8,6 @@ import { safeLoad } from 'js-yaml'; import { AssetReference, Dataset, RegistryPackage } from '../../../../common/types'; import { CallESAsCurrentUser } from '../../../../server/lib/cluster_access'; import { getAssetsData } from '../../../packages/assets'; -import * as Registry from '../../../registry'; import { Field } from '../../fields/field'; import { generateMappings, generateTemplateName, getTemplate } from './template';