Skip to content

Commit

Permalink
Add input plugin with dash in id (integration tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
breml committed Sep 9, 2021
1 parent f22e89f commit 482dcea
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/daemon/api/grpc/api.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/daemon/filtermock/filtermock.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (m Mocks) Walk(c *astutil.Cursor) {
c.Delete()
return
}
replacement.Attributes = append(replacement.Attributes, ast.NewStringAttribute("id", id, ast.Bareword))
replacement.Attributes = append(replacement.Attributes, ast.NewStringAttribute("id", id, ast.DoubleQuoted))
c.Replace(replacement)
}
}
2 changes: 1 addition & 1 deletion internal/daemon/logstashconfig/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (r replaceInputsWalker) replaceInputs(c *astutil.Cursor) {
}

var attrs []ast.Attribute
attrs = append(attrs, ast.NewStringAttribute("address", fmt.Sprintf("%s_%s_%s", "__lfv_input", r.idPrefix, id), ast.Bareword))
attrs = append(attrs, ast.NewStringAttribute("address", fmt.Sprintf("%s_%s_%s", "__lfv_input", r.idPrefix, id), ast.DoubleQuoted))

for _, attr := range c.Plugin().Attributes {
if attr == nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/daemon/logstashconfig/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestReplaceInputs(t *testing.T) {

wantConfig: `input {
pipeline {
address => __lfv_input_prefix_testid
address => "__lfv_input_prefix_testid"
}
}
`,
Expand Down
2 changes: 1 addition & 1 deletion testdata/basic_pipeline/main/dir/main2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ filter {
id => mutate2
add_tag => [ "main2_passed" ]
}
}
}
2 changes: 1 addition & 1 deletion testdata/basic_pipeline_debug/main/main.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
input {
stdin {
id => stdin
id => "stdin-with-dash"
}
}

Expand Down
2 changes: 1 addition & 1 deletion testdata/testcases/basic_pipeline_debug/testcase1.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ignore": [
"@timestamp"
],
"input_plugin": "stdin",
"input_plugin": "stdin-with-dash",
"testcases": [
{
"input": [
Expand Down
2 changes: 1 addition & 1 deletion testdata/testcases/basic_pipeline_debug/testcase2.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"ignore": [
"@timestamp"
],
"input_plugin": "stdin",
"input_plugin": "stdin-with-dash",
"export_metadata": true,
"testcases": [
{
Expand Down

0 comments on commit 482dcea

Please sign in to comment.