[Monitoring] Stop using constructor.name for logstash pipelines (#87386)

* Use typeString instead

* Used wrong type string

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Chris Roberson 2021-01-11 14:32:19 -05:00 committed by GitHub
parent 89e7cd6808
commit ff8d30bc6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,15 +9,14 @@ import { IfStatement } from './if_statement';
import { Queue } from './queue';
export function makeStatement(pipelineGraphVertex, pipelineStage) {
const klass = pipelineGraphVertex.constructor.name;
switch (klass) {
case 'PluginVertex':
switch (pipelineGraphVertex.typeString) {
case 'plugin':
return PluginStatement.fromPipelineGraphVertex(pipelineGraphVertex, pipelineStage);
case 'IfVertex':
case 'if':
return IfStatement.fromPipelineGraphVertex(pipelineGraphVertex, pipelineStage);
case 'QueueVertex':
case 'queue':
return Queue.fromPipelineGraphVertex(pipelineGraphVertex, pipelineStage);
default:
throw new Error(`Unknown vertex class: ${klass}`);
throw new Error(`Unknown vertex class: ${pipelineGraphVertex.typeString}`);
}
}