@@ -30,6 +30,7 @@ import (
30
30
type Integration struct {
31
31
Build * BuildManifest `json:"build,omitempty" yaml:"build,omitempty"`
32
32
Manifest Manifest `json:"manifest,omitempty" yaml:"manifest,omitempty"`
33
+ Input * DataStream `json:"input,omitempty" yaml:"input,omitempty"`
33
34
DataStreams map [string ]* DataStream `json:"data_streams,omitempty" yaml:"data_streams,omitempty"`
34
35
Changelog Changelog `json:"changelog,omitempty" yaml:"changelog,omitempty"`
35
36
@@ -436,7 +437,6 @@ func Read(path string) (*Integration, error) {
436
437
}
437
438
integration .Manifest .sourceFile = sourceFile
438
439
annotateFileMetadata (integration .Manifest .sourceFile , & integration .Manifest )
439
-
440
440
sourceFile = filepath .Join (path , "changelog.yml" )
441
441
if err := readYAML (sourceFile , & integration .Changelog , true ); err != nil {
442
442
return nil , err
@@ -455,21 +455,31 @@ func Read(path string) (*Integration, error) {
455
455
integration .Build .sourceFile = sourceFile
456
456
}
457
457
458
- dataStreams , err := filepath .Glob (filepath .Join (path , "data_stream/*/manifest.yml" ))
459
- if err != nil {
460
- return nil , err
458
+ var dataStreams []string
459
+ if integration .Manifest .Type == "input" {
460
+ dataStreams = []string {filepath .Join (path , "manifest.yml" )}
461
+ } else {
462
+ var err error
463
+ dataStreams , err = filepath .Glob (filepath .Join (path , "data_stream/*/manifest.yml" ))
464
+ if err != nil {
465
+ return nil , err
466
+ }
461
467
}
462
468
for _ , manifestPath := range dataStreams {
463
469
ds := & DataStream {
464
470
sourceDir : filepath .Dir (manifestPath ),
465
471
}
466
- integration .DataStreams [filepath .Base (ds .sourceDir )] = ds
472
+ if integration .Manifest .Type == "input" {
473
+ integration .Input = ds
474
+ } else {
475
+ integration .DataStreams [filepath .Base (ds .sourceDir )] = ds
467
476
468
- if err := readYAML (manifestPath , & ds .Manifest , true ); err != nil {
469
- return nil , err
477
+ if err := readYAML (manifestPath , & ds .Manifest , true ); err != nil {
478
+ return nil , err
479
+ }
480
+ ds .Manifest .sourceFile = manifestPath
481
+ annotateFileMetadata (ds .Manifest .sourceFile , & ds .Manifest )
470
482
}
471
- ds .Manifest .sourceFile = manifestPath
472
- annotateFileMetadata (ds .Manifest .sourceFile , & ds .Manifest )
473
483
474
484
pipelines , err := filepath .Glob (filepath .Join (ds .sourceDir , "elasticsearch/ingest_pipeline/*.yml" ))
475
485
if err != nil {
0 commit comments