-
Notifications
You must be signed in to change notification settings - Fork 5
Allow for single grype installation with multiple shared DBs #113
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
Conversation
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
store_base = install_base(name=config.tool_name, store_root=store_root) | ||
|
||
version = config.tool_version | ||
if config.tool_name.startswith("grype"): |
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.
The tool
base class knowing about grype is another signal that it might be time to refactor.
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.
one of a hundred signals 🔥
tool_obj.run("db", "update") | ||
|
||
return tool_obj | ||
|
||
@property | ||
def db_root(self) -> str: | ||
return os.path.join(self.path, "db") | ||
return os.path.join(self.path, "db", self.db_identity) |
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.
So this will just have oss
in it for grype installs that are using the normal database?
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.
yup 👍
@@ -77,7 +77,7 @@ def find( | |||
by_tool: str = "", | |||
by_time: str = "", | |||
by_description: str = "", | |||
store_root: str = None, | |||
store_root: Optional[str] = None, |
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.
nit: I'd prefer if unrelated changes were in a separate PR.
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.
I highlighted that I was upgrading logging and type hints around store_root as found while integrating this into grype-db
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.
I saw that. I just wish it had all been done as a previous PR; that would have made it much easier to review both PRs.
Let me take another stab at this one. Thanks for the review @willmurphyscode |
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
11cf829
to
c9a6ece
Compare
This PR allows for a single installation of grype share multiple DB and track by the checksum of the DB (or is as
oss
).It was noticed while working on this that:
compare_results
) do not allow for passing an optionalstore_root
as done elsewhere. This option has been added.and to summarize long tool and image strings intelligently(edit: descoped)