Skip to content
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

fix: add option to change java db repository #1179

Merged
merged 4 commits into from
Apr 24, 2023

Conversation

nobbs
Copy link
Contributor

@nobbs nobbs commented Apr 23, 2023

Description

Trivy does support the use of custom vulnerability database repositories for both the regular DB as well as the Java one (since aquasecurity/trivy#3595) - trivy-operator only supports the former. This PR provides a way to configure the latter one, too.
Also updated the existing tests and added two simple new ones for this new option.

I've also refactored some repetitive env var setup in the plugins/trivy/plugin.go file by reusing the already existing methods constructEnvVarSourceFromConfigMap and constructEnvVarSourceFromSecret where possible.

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@nobbs nobbs force-pushed the fix/java-db-repository-options branch from 2ba39ef to 493116f Compare April 23, 2023 11:47
@nobbs nobbs changed the title fix: add java db repository options to client/server mode fix: add option to change java db repository Apr 23, 2023
Copy link
Contributor

@chen-keinan chen-keinan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could please also update trivy-config-docs ?

pkg/plugins/trivy/plugin.go Outdated Show resolved Hide resolved
@chen-keinan
Copy link
Contributor

chen-keinan commented Apr 24, 2023

@nobbs thanks you for this contribution , I have left comments.
could you also please rebase your branch with upstream.

@nobbs nobbs force-pushed the fix/java-db-repository-options branch from 732f71c to 8ab7000 Compare April 24, 2023 09:41
Alexej Disterhoft added 3 commits April 24, 2023 11:47
the two methods already exist, so let's migrate the env vars to also use them, as it reduces repetition quite a lot
@nobbs nobbs force-pushed the fix/java-db-repository-options branch from 8ab7000 to a2b28d6 Compare April 24, 2023 09:48
@nobbs nobbs requested a review from chen-keinan April 24, 2023 09:48
@nobbs
Copy link
Contributor Author

nobbs commented Apr 24, 2023

I've taken care of your comments. Also, grouped the commits again. Should be good now; if not, let me know ;)

@chen-keinan
Copy link
Contributor

@nobbs lgtm 🚀

@chen-keinan chen-keinan merged commit 01235e7 into aquasecurity:main Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants