-
Notifications
You must be signed in to change notification settings - Fork 60
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
Remove caches for the KATalogus in the scheduler #4108
base: main
Are you sure you want to change the base?
Remove caches for the KATalogus in the scheduler #4108
Conversation
Add filter parameter in the KATalogus Plugins API to allow filtering on what the plugin consumes and produces to support it
plugins = [plugin for plugin in plugins if filter_params.consumes.issubset(set(plugin.consumes))] | ||
|
||
if filter_params.produces is not None: | ||
plugins = [plugin for plugin in plugins if filter_params.produces.issubset(set(plugin.produces))] |
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.
Does this actually allow for plugins that only produce one of the filtered produce values?
Eg, I filter on produces, X or Y. this plugin produces Y and Z.
X and y is not a subset of Y and Z. It does produce an intersect result which Is probably what we are looking for as filters are usually OR, not AND?
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.
plugins = [plugin for plugin in plugins if filter_params.produces.issubset(set(plugin.produces))] | |
plugins = [plugin for plugin in plugins if filter_params.produces.intersection(set(plugin.produces))] |
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.
Perhaps not relevant to the discussion, but the scheduler will only request one type.
@@ -70,6 +70,12 @@ def list_plugins( | |||
# filter plugins by scan level for boefje plugins | |||
plugins = [plugin for plugin in plugins if plugin.type != "boefje" or plugin.scan_level >= filter_params.scan_level] | |||
|
|||
if filter_params.consumes is not None: | |||
plugins = [plugin for plugin in plugins if filter_params.consumes.issubset(set(plugin.consumes))] |
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.
plugins = [plugin for plugin in plugins if filter_params.consumes.issubset(set(plugin.consumes))] | |
plugins = [plugin for plugin in plugins if filter_params.consumes.intersection(set(plugin.consumes))] |
|
Changes
Issue link
Reference #3357
QA notes
Interaction between the scheduler and katalogus has been optimized. Scanning of large volumes of items should function better, and without any issues monitored in either the katalogus or the scheduler.
Code Checklist
.env
changes files if required and changed the.env-dist
accordingly.Checklist for code reviewers:
Copy-paste the checklist from the docs/source/templates folder into your comment.
Checklist for QA:
Copy-paste the checklist from the docs/source/templates folder into your comment.