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
[ebpf] Check for bpftool presence before running plugin #3413
[ebpf] Check for bpftool presence before running plugin #3413
Conversation
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
@@ -15,6 +15,7 @@ class Ebpf(Plugin, IndependentPlugin): | |||
short_desc = 'eBPF tool' | |||
plugin_name = 'ebpf' | |||
profiles = ('system', 'kernel', 'network') | |||
commands = ('bpftool',) |
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.
commands
mean the plugin will be enabled any time some command from the tuple is present. So the line will be a new independent way how the plugin will be enabled by default.
If your aim is to enable the plugin automatically only when the binary is present, I think you need to test it in overwritten check_enabled
method..?
64977c0
to
2226f25
Compare
Sorry this one definitely slipped through the cracks over the last few months.
If @jcastill sorry for the churn here, but the original change was correct - just add the |
Good point, my mistake. I hadn't realized the |
@TurboTurtle @pmoravec it's ok :) I'll revert this change and push again in a bit. |
The plugin was running even when the bpftool was not present, throwing an exception when it tried to parse a json output: INFO: [plugin:ebpf] Could not parse bpftool prog list as JSON: Expecting value: line 1 column 1 (char 0) It now checks if the program is present before running any command at all. Related: RH SUPDEV-151 Signed-off-by: Jose Castillo <jcastillo@redhat.com>
2226f25
to
aab9349
Compare
The plugin was running even when the bpftool was
not present, throwing an exception when it tried to parse a json output:
INFO: [plugin:ebpf] Could not parse bpftool prog list as
JSON: Expecting value: line 1 column 1 (char 0)
It now checks if the program is present before running any command at all.
Related: RH SUPDEV-151
Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines