Skip to content

Commit

Permalink
[ML] Fix bug with fields.yml not defined, add jest tests for new tran…
Browse files Browse the repository at this point in the history
…sform installation mechanism in Fleet (#142159)

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
qn895 and kibanamachine authored Oct 5, 2022
1 parent d3370cf commit a3e2af4
Show file tree
Hide file tree
Showing 3 changed files with 677 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,10 @@ const installTransformsAssets = async (
await Promise.all(
destinationIndexTemplates
.map((destinationIndexTemplate) => {
const customMappings = transformsSpecifications
.get(destinationIndexTemplate.transformModuleId)
?.get('mappings');
const customMappings =
transformsSpecifications
.get(destinationIndexTemplate.transformModuleId)
?.get('mappings') ?? {};
const registryElasticsearch: RegistryElasticsearch = {
'index_template.settings': destinationIndexTemplate.template.settings,
'index_template.mappings': destinationIndexTemplate.template.mappings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { PACKAGES_SAVED_OBJECT_TYPE } from '../../../../constants';
import { getAsset } from './common';
import { installTransforms } from './install';

describe('test transform install', () => {
describe('test transform install with legacy schema', () => {
let esClient: ReturnType<typeof elasticsearchClientMock.createElasticsearchClient>;
let savedObjectsClient: jest.Mocked<SavedObjectsClientContract>;
beforeEach(() => {
Expand Down
Loading

0 comments on commit a3e2af4

Please sign in to comment.