-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix remove ingest processor handing ignore_missing parameter not corr…
…ectly Signed-off-by: Gao Binlong <gbinlong@amazon.com>
- Loading branch information
1 parent
d7aa6dd
commit 6609905
Showing
4 changed files
with
129 additions
and
14 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
93 changes: 93 additions & 0 deletions
93
...gest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/290_remove_processor.yml
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,93 @@ | ||
--- | ||
teardown: | ||
- do: | ||
ingest.delete_pipeline: | ||
id: "my_pipeline" | ||
ignore: 404 | ||
|
||
--- | ||
"Test remove processor with non-existing field and without ignore_missing": | ||
- do: | ||
ingest.put_pipeline: | ||
id: "my_pipeline" | ||
body: > | ||
{ | ||
"description": "_description", | ||
"processors": [ | ||
{ | ||
"remove" : { | ||
"field" : "{{unknown}}" | ||
} | ||
} | ||
] | ||
} | ||
- match: { acknowledged: true } | ||
|
||
- do: | ||
catch: /field path cannot be null nor empty/ | ||
index: | ||
index: test | ||
id: 1 | ||
pipeline: "my_pipeline" | ||
body: { message: "foo bar baz" } | ||
|
||
--- | ||
"Test remove processor with resolved field path doesn't exist": | ||
- do: | ||
ingest.put_pipeline: | ||
id: "my_pipeline" | ||
body: > | ||
{ | ||
"description": "_description", | ||
"processors": [ | ||
{ | ||
"remove" : { | ||
"field" : "{{foo}}" | ||
} | ||
} | ||
] | ||
} | ||
- match: { acknowledged: true } | ||
|
||
- do: | ||
catch: /field \[bar\] doesn\'t exist/ | ||
index: | ||
index: test | ||
id: 1 | ||
pipeline: "my_pipeline" | ||
body: { | ||
message: "foo bar baz", | ||
foo: "bar" | ||
} | ||
|
||
--- | ||
"Test remove processor with non-existing field and ignore_missing": | ||
- do: | ||
ingest.put_pipeline: | ||
id: "my_pipeline" | ||
body: > | ||
{ | ||
"description": "_description", | ||
"processors": [ | ||
{ | ||
"remove" : { | ||
"field" : "{{unknown}}", | ||
"ignore_missing" : true | ||
} | ||
} | ||
] | ||
} | ||
- match: { acknowledged: true } | ||
|
||
- do: | ||
index: | ||
index: test | ||
id: 1 | ||
pipeline: "my_pipeline" | ||
body: { message: "foo bar baz" } | ||
|
||
- do: | ||
get: | ||
index: test | ||
id: 1 | ||
- match: { _source.message: "foo bar baz" } |