-
Notifications
You must be signed in to change notification settings - Fork 527
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* removes fields target from top-level Makefile * vendors github.com/elastic/beats/libbeat/generator/fields * cleans up github.com/ericchiang/k8s/...
- Loading branch information
1 parent
9ee4b8c
commit 85527f2
Showing
64 changed files
with
3,481 additions
and
920 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
BEAT_NAME=libbeat | ||
TEST_ENVIRONMENT?=true | ||
SYSTEM_TESTS=true | ||
FIELDS_FILE_PATH=processors | ||
|
||
include scripts/Makefile | ||
|
||
# Collects all fields from processors | ||
.PHONY: fields | ||
fields: | ||
@cp _meta/fields.common.yml _meta/fields.generated.yml | ||
@cat processors/*/_meta/fields.yml >> _meta/fields.generated.yml | ||
|
||
# Collects all dependencies and then calls update | ||
.PHONY: collect | ||
collect: fields | ||
collect: libbeat_fields |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
"os" | ||
"path/filepath" | ||
|
||
"github.com/elastic/beats/libbeat/generator/fields" | ||
) | ||
|
||
func main() { | ||
esBeatsPath := flag.String("es_beats_path", "..", "Path to elastic/beats") | ||
beatPath := flag.String("beat_path", ".", "Path to your Beat") | ||
flag.Parse() | ||
|
||
beatFieldsPath := flag.Args() | ||
name := filepath.Base(*beatPath) | ||
|
||
err := os.MkdirAll(filepath.Join(*beatPath, "_meta"), 0744) | ||
if err != nil { | ||
fmt.Printf("Cannot creata _meta dir for %s: %v\n", name, err) | ||
os.Exit(1) | ||
} | ||
|
||
if len(beatFieldsPath) == 0 { | ||
fmt.Println("No field files to collect") | ||
err = fields.AppendFromLibbeat(*esBeatsPath, *beatPath) | ||
if err != nil { | ||
fmt.Printf("Cannot generate global fields.yml for %s: %v\n", name, err) | ||
os.Exit(2) | ||
} | ||
return | ||
} | ||
|
||
if *beatPath == "" { | ||
fmt.Println("beat_path cannot be empty") | ||
os.Exit(1) | ||
} | ||
|
||
pathToModules := filepath.Join(*beatPath, beatFieldsPath[0]) | ||
fieldFiles, err := fields.CollectModuleFiles(pathToModules) | ||
if err != nil { | ||
fmt.Printf("Cannot collect fields.yml files: %v\n", err) | ||
os.Exit(2) | ||
|
||
} | ||
|
||
err = fields.Generate(*esBeatsPath, *beatPath, fieldFiles) | ||
if err != nil { | ||
fmt.Printf("Cannot generate global fields.yml file for %s: %v\n", name, err) | ||
os.Exit(3) | ||
} | ||
|
||
fmt.Printf("Generated fields.yml for %s\n", name) | ||
} |
Oops, something went wrong.