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(scanner): Change logic of creating entities #309

Merged
merged 26 commits into from
Oct 22, 2024

Conversation

dorneanu
Copy link
Collaborator

@dorneanu dorneanu commented Oct 21, 2024

Description

As described in Issue #279 due to performance issues we decided to change the order and also the logic how entities are created in the different scanners.

The k8s-scanner will now create Components and ComponentVersion objects based on the information gets from the K8s scanner.

The keppel scanner will now fetch the trivy report only for available components, component versions in the DB. It will then create Issue objects.

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help
  • Separate ticket for tests # (issue/pr)

Added to documentation?

  • 📜 README.md
  • 🤝 Documentation pages updated
  • 🙅 no documentation needed
  • (if applicable) generated OpenAPI docs for CRD changes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Collaborator

@drochow drochow left a comment

Choose a reason for hiding this comment

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

Generally looks good to me.
My main question would be if we want to change the logic to directly get a list of components with it's component versions instead of looping through components and getting versions from them.

What do you think?

scanner/keppel/main.go Outdated Show resolved Hide resolved
scanner/keppel/main.go Outdated Show resolved Hide resolved
scanner/keppel/main.go Outdated Show resolved Hide resolved
scanner/keppel/processor/processor.go Outdated Show resolved Hide resolved
scanner/keppel/scanner/scanner.go Outdated Show resolved Hide resolved
scanner/keppel/scanner/scanner.go Outdated Show resolved Hide resolved

- Go 1.15 or later
- Access to a Kubernetes cluster
- Heureka system for reporting findings
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we expecting certain labels on the Kubernetes pods?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We do but its configurable no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What do you mean? "expecting certain labels" should also be part of the README?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, this is referring back to the fact that we build support groups from certain labels / annotations on the kubernetes resources

drochow
drochow previously approved these changes Oct 22, 2024
Copy link
Collaborator

@drochow drochow left a comment

Choose a reason for hiding this comment

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

LGTM, just a commented line I'd remove

scanner/keppel/main.go Outdated Show resolved Hide resolved
@drochow drochow merged commit d26a8fb into main Oct 22, 2024
7 checks passed
@drochow drochow deleted the dorneanu/issue-278/Change-logic-of-entity-creation branch October 22, 2024 10:50
dustindemmerle pushed a commit that referenced this pull request Oct 23, 2024
* First commit

* Wip

* Revert f04feab

* Wip

* Wip

* Wip

* Wip

* Wip

* Wip

* Change naming

* Add concurrency

* Add READMEs

* Automatic application of license header

* Fix #309 (comment)

* Fix #discussion_r1808503568

* Fix #309 (comment)

* Fix #309 (comment)

* Automatic application of license header

* Fix #309 (comment)

* Refactoring

* Update dependencies

* Fix logic for ExtractImageInfo

* Add unit tests for ExtractImageInfo

* Automatic application of license header

* Clean-up

---------

Co-authored-by: License Bot <[email protected]>
Co-authored-by: Michael Reimsbach <[email protected]>
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.

3 participants