Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ingest Manager] Support updated package output structure #69864

Merged
merged 19 commits into from
Jun 29, 2020
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
93aeaa4
Update EPM package registry typings to reflect registry changes
jen-huang Jun 23, 2020
cf240c3
Change `dataset.id` references to `dataset.name`
jen-huang Jun 23, 2020
93b83df
Fix RegistryStream
jen-huang Jun 23, 2020
eb77efc
Fix packageToConfigDatasourceInputs service
jen-huang Jun 24, 2020
cfdc57f
Fix assignPackageStream service
jen-huang Jun 24, 2020
5a2d688
Fix validateDatasource service
jen-huang Jun 24, 2020
c3c75c4
Fix configure data source components
jen-huang Jun 24, 2020
a5a8f11
Fix variable
jen-huang Jun 24, 2020
7a63526
Merge remote-tracking branch 'upstream/master' into ingest/remove-reg…
jen-huang Jun 24, 2020
fe5a6ae
Fix stream template installation
jen-huang Jun 24, 2020
f34e642
Add support for `input[].dataset.type` and change `stream.dataset` ma…
jen-huang Jun 24, 2020
7a01fd0
Nest package information under `meta` in agent config yaml
jen-huang Jun 25, 2020
67f7c89
Move `dataset.type` to stream level instead of input level
jen-huang Jun 25, 2020
b9f0ddb
Make single call to fetch registry package information instead of doi…
jen-huang Jun 25, 2020
2e0eaf0
Fix type issues
jen-huang Jun 25, 2020
3b4e75e
Merge remote-tracking branch 'upstream/master' into ingest/remove-reg…
jen-huang Jun 25, 2020
bf92368
Merge remote-tracking branch 'upstream/master' into ingest/remove-reg…
jen-huang Jun 26, 2020
cd6f2d1
Update endpoint test assertion
jen-huang Jun 26, 2020
e06bf3f
Merge branch 'master' into ingest/remove-registry-datasources
elasticmachine Jun 29, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const CONFIG_KEYS_ORDER = [
'inputs',
'enabled',
'use_output',
'package',
'meta',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michalpristas for your awareness. As Agent ignores this at the moment, it should not have any effect.

'input',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('Ingest Manager - storedDatasourcesToAgentInputs', () => {
{
id: 'test-logs-foo',
enabled: true,
dataset: 'foo',
dataset: { name: 'foo', type: 'logs' },
vars: {
fooVar: { value: 'foo-value' },
fooVar2: { value: [1, 2] },
Expand All @@ -52,7 +52,7 @@ describe('Ingest Manager - storedDatasourcesToAgentInputs', () => {
{
id: 'test-logs-bar',
enabled: true,
dataset: 'bar',
dataset: { name: 'bar', type: 'logs' },
vars: {
barVar: { value: 'bar-value' },
barVar2: { value: [1, 2] },
Expand Down Expand Up @@ -101,23 +101,41 @@ describe('Ingest Manager - storedDatasourcesToAgentInputs', () => {
});

it('returns agent inputs', () => {
expect(storedDatasourcesToAgentInputs([{ ...mockDatasource, inputs: [mockInput] }])).toEqual([
expect(
storedDatasourcesToAgentInputs([
{
...mockDatasource,
package: {
name: 'mock-package',
title: 'Mock package',
version: '0.0.0',
},
inputs: [mockInput],
},
])
).toEqual([
{
id: 'some-uuid',
name: 'mock-datasource',
type: 'test-logs',
dataset: { namespace: 'default' },
use_output: 'default',
meta: {
package: {
name: 'mock-package',
version: '0.0.0',
},
},
streams: [
{
id: 'test-logs-foo',
dataset: { name: 'foo' },
dataset: { name: 'foo', type: 'logs' },
fooKey: 'fooValue1',
fooKey2: ['fooValue2'],
},
{
id: 'test-logs-bar',
dataset: { name: 'bar' },
dataset: { name: 'bar', type: 'logs' },
},
],
},
Expand Down Expand Up @@ -147,7 +165,7 @@ describe('Ingest Manager - storedDatasourcesToAgentInputs', () => {
streams: [
{
id: 'test-logs-foo',
dataset: { name: 'foo' },
dataset: { name: 'foo', type: 'logs' },
fooKey: 'fooValue1',
fooKey2: ['fooValue2'],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export const storedDatasourcesToAgentInputs = (
id: datasource.id || datasource.name,
name: datasource.name,
type: input.type,
dataset: { namespace: datasource.namespace || 'default' },
dataset: {
namespace: datasource.namespace || 'default',
},
use_output: DEFAULT_OUTPUT.name,
...Object.entries(input.config || {}).reduce((acc, [key, { value }]) => {
acc[key] = value;
Expand All @@ -35,7 +37,7 @@ export const storedDatasourcesToAgentInputs = (
.map((stream) => {
const fullStream: FullAgentConfigInputStream = {
id: stream.id,
dataset: { name: stream.dataset },
dataset: stream.dataset,
...stream.agent_stream,
...Object.entries(stream.config || {}).reduce((acc, [key, { value }]) => {
acc[key] = value;
Expand All @@ -50,9 +52,11 @@ export const storedDatasourcesToAgentInputs = (
};

if (datasource.package) {
fullInput.package = {
name: datasource.package.name,
version: datasource.package.version,
fullInput.meta = {
package: {
name: datasource.package.name,
version: datasource.package.version,
},
};
}

Expand Down
Loading