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

feat: use trivy as a binary instead of a library #786

Merged

Conversation

pmengelbert
Copy link
Contributor

@pmengelbert pmengelbert commented Jul 5, 2023

resolves #656

This PR will likely improve memory usage by the scanner.

@codecov-commenter
Copy link

codecov-commenter commented Jul 5, 2023

Codecov Report

Merging #786 (142d52a) into main (576baf4) will decrease coverage by 0.97%.
The diff coverage is 56.71%.

@@            Coverage Diff             @@
##             main     #786      +/-   ##
==========================================
- Coverage   15.80%   14.83%   -0.97%     
==========================================
  Files          13       13              
  Lines        1607     1496     -111     
==========================================
- Hits          254      222      -32     
+ Misses       1325     1253      -72     
+ Partials       28       21       -7     
Flag Coverage Δ
unittests 14.83% <56.71%> (-0.97%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/scanners/trivy/helpers.go 0.00% <ø> (-47.92%) ⬇️
pkg/scanners/trivy/trivy.go 0.00% <0.00%> (ø)
pkg/scanners/trivy/types.go 38.83% <62.29%> (+11.17%) ⬆️

@pmengelbert pmengelbert force-pushed the feat/trivy_as_binary/new_scanner branch from 8b8bc82 to 950b2dd Compare July 5, 2023 19:50
@pmengelbert pmengelbert changed the title feat: testing ci feat: use trivy as a binary instead of a library Jul 5, 2023
@pmengelbert pmengelbert marked this pull request as ready for review July 5, 2023 20:52
Installs the published trivy binary to the trivy-scanner image. Make
variables TRIVY_BINARY_REPO TRIVY_BINARY_TAG, and TRIVY_BINARY_IMG have
been added to provide control over the versioning.

This is a beginning of a change intended to reduce maintentance and
to resolve resource issues that have arisen. Instead of using trivy as a
library (which has a constantly-shifting API), we will use the published
binary.

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
@pmengelbert pmengelbert force-pushed the feat/trivy_as_binary/new_scanner branch from 948a6fd to e819a4b Compare July 6, 2023 13:04
For testing Config.cliArgs(...)

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Copy link
Member

@sozercan sozercan left a comment

Choose a reason for hiding this comment

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

Great job! LGTM

@pmengelbert pmengelbert merged commit 7f8c349 into eraser-dev:main Jul 6, 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.

Use trivy as a binary instead of a library
3 participants