Repository navigation
datastore: drop non-matching vulnerabilities while scanning Get() #2049
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
base: main
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -19,6 +19,10 @@ type GetOpts struct { | |
| // VersionFiltering enables filtering based on the normalized versions in | ||
| // the database. | ||
| VersionFiltering bool | ||
| // Vulnerable reports whether a scanned vulnerability affects this record. | ||
| // A nil Vulnerable retains every row. When several records share a package | ||
| // ID, the row is retained if any of them accepts it. | ||
| Vulnerable func(ctx context.Context, record *claircore.IndexRecord, vuln *claircore.Vulnerability) (bool, error) | ||
|
Contributor
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. Could we document that Vulnerable runs while the database transaction and batch are open? Callback implementations should be aware of database access or other blocking steps.
Contributor
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. Yeah I can add something but probably not here as it is implementation-agnostic
Contributor
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. |
||
| } | ||
|
|
||
| // Vulnerability is the interface for querying stored Vulnerabilities. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.