-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(cli): avoid unnecessary memory consumption
The new process to get the list of container assessments is 1) Check if the user provided a list of registries and repositories, if so, use those filters instead of fetching the entire data from all registries, repositories, local scanners, etc. (This is a memory utilization improvement) 2) If no filter by registries and/or repos, then fetch all data from all registries and all local scanners, we purposely split them in two search requests since there could be so much data that we get to the 500,000 rows if data and we could potentially miss some information 3) Either 1) or 2) will generate a tree of unique container vulnerability assessments (see the `treeCtrVuln` type), with this tree we will generate one last API request to unique evaluations per image (This is a memory utilization improvement) 4) Finally, if we get information from the queried assessments, we build a summary that will ultimately get stored in the cache for subsequent commands `treeCtrVuln` and `ctrVuln` are types that help us generate an tree of container vulnerability assessments that are unique per image id, that is, there will never be duplicates of the same image with different evaluation guids (evalGuid) Signed-off-by: Salim Afiune Maya <[email protected]>
- Loading branch information
Showing
4 changed files
with
204 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters