-
Notifications
You must be signed in to change notification settings - Fork 175
fix(userspace/libsinsp): allow plugin filterchecks args to be both index or key #2280
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
fix(userspace/libsinsp): allow plugin filterchecks args to be both index or key #2280
Conversation
…dex or key. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FedeDP The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/milestone 0.21.0 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2280 +/- ##
==========================================
- Coverage 75.33% 75.32% -0.01%
==========================================
Files 280 280
Lines 34554 34556 +2
Branches 5901 5902 +1
==========================================
Hits 26031 26031
- Misses 8523 8525 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Perf diff from master - unit tests
Heap diff from master - unit tests
Heap diff from master - scap file
Benchmarks diff from master
|
@@ -239,8 +244,10 @@ void sinsp_filter_check_plugin::extract_arg_index(std::string_view full_field_na | |||
message = " has an invalid index argument not representable on 64 bit: "; | |||
} | |||
} | |||
throw sinsp_exception(string("filter ") + string(full_field_name) + string(" ") + | |||
m_field->m_name + message + m_argstr); | |||
if(required) { |
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.
Don't throw any exception in case the index is not required (ie: we want also to try to parse this arg as key).
What type of PR is this?
/kind bug
Any specific area of the project related to this PR?
/area libsinsp
Does this PR require a change in the driver versions?
What this PR does / why we need it:
Plugin filterchecks support having an arg that is either index or key, but not both together; that's because we try to parse the
[%arg]
as index first, and if we are not able to, we throw an exception without further checking if we need to try to parse the arg as string key too.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: