From 368007de3b4fdb1e166acfe31c6d4f299eb9a0aa Mon Sep 17 00:00:00 2001 From: Milton Hultgren Date: Fri, 5 Jul 2024 18:12:19 +0200 Subject: [PATCH] Use schema version constant --- .../entities/ingest_pipeline/generate_history_processors.ts | 3 ++- .../lib/entities/ingest_pipeline/generate_latest_processors.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/ingest_pipeline/generate_history_processors.ts b/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/ingest_pipeline/generate_history_processors.ts index 875f515b0a3a5..e6d85472c7f97 100644 --- a/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/ingest_pipeline/generate_history_processors.ts +++ b/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/ingest_pipeline/generate_history_processors.ts @@ -6,6 +6,7 @@ */ import { EntityDefinition } from '@kbn/entities-schema'; +import { ENTITY_SCHEMA_VERSION_V1 } from '../../../../common/constants_entities'; import { generateHistoryIndexName } from '../helpers/generate_component_id'; function createIdTemplate(definition: EntityDefinition) { @@ -72,7 +73,7 @@ export function generateHistoryProcessors(definition: EntityDefinition) { { set: { field: 'entity.schemaVersion', - value: 'v1', + value: ENTITY_SCHEMA_VERSION_V1, }, }, { diff --git a/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/ingest_pipeline/generate_latest_processors.ts b/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/ingest_pipeline/generate_latest_processors.ts index ad2cafdd7a99b..12da41fa60b72 100644 --- a/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/ingest_pipeline/generate_latest_processors.ts +++ b/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/ingest_pipeline/generate_latest_processors.ts @@ -6,6 +6,7 @@ */ import { EntityDefinition } from '@kbn/entities-schema'; +import { ENTITY_SCHEMA_VERSION_V1 } from '../../../../common/constants_entities'; import { generateLatestIndexName } from '../helpers/generate_component_id'; function mapDestinationToPainless(destination: string, source: string) { @@ -66,7 +67,7 @@ export function generateLatestProcessors(definition: EntityDefinition) { { set: { field: 'entity.schemaVersion', - value: 'v1', + value: ENTITY_SCHEMA_VERSION_V1, }, }, ...(definition.staticFields != null