-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
eventbridge: fix handling of list elements #10600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -573,10 +573,12 @@ def get_log_events(func_name, delay): | |
| raw_message = event["message"] | ||
| if ( | ||
| not raw_message | ||
| or "START" in raw_message | ||
| or "END" in raw_message | ||
| or "REPORT" in raw_message | ||
| # necessary until tail is updated in docker images. See this PR: | ||
| or raw_message.startswith("INIT_START") | ||
| or raw_message.startswith("START") | ||
| or raw_message.startswith("END") | ||
| or raw_message.startswith( | ||
| "REPORT" | ||
| ) # necessary until tail is updated in docker images. See this PR: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That PR links a patch from 2015 🤔 Is there a better open issue we could link to track this?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have to admit that I didn't check this PR at all. The fix here is mostly that a message can contain the words we filter for by accident (which is exactly what happened), while we should only filter for these words at the start
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the clarification. Would be a nice-to-have clarifying comment 👍 |
||
| # http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.24-111-g1118f32 | ||
| or "tail: unrecognized file system type" in raw_message | ||
| or regex_filter | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // Motivated by https://github.com/localstack/localstack/pull/10600 | ||
| { | ||
| "Event": { | ||
| "id": "1", | ||
| "source": "test-source", | ||
| "detail-type": "test-detail-type", | ||
| "account": "123456789012", | ||
| "region": "us-east-2", | ||
| "time": "2022-07-13T13:48:01Z", | ||
| "detail": { | ||
| "automations": [ | ||
| {"key1": "value1"}, | ||
| // the "exists" operator matches because at least one element of the list matches | ||
| {"id": "match-does-exist"}, | ||
| {"key2": "value2"} | ||
| ] | ||
| } | ||
| }, | ||
| "EventPattern": { | ||
| "detail": { | ||
| "automations": { | ||
| "id": [{"exists": true}] | ||
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch. Thank you @baermat 🙏