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: add SBOM CRD database storage #13

Conversation

fabriziosestito
Copy link
Collaborator

@fabriziosestito fabriziosestito commented Oct 25, 2024

This PR adds the SBOM CRD to the database storage.
It implements the apiserver storage interface so that resources can be stored in an external database.
As for now, only sqlite is supported, but it could be extended to other databases by changing the driver.

We are using modernc.org/sqlite which does not require CGO enabled.
The watch is implemented by using watch.Broadcaster.

The store can be generalized by using generics to support the other CRD provided by the storage component (Image, VulnerabilityReport).

@fabriziosestito fabriziosestito force-pushed the feat/add-sbom-database-storage branch from 7a3a752 to e0fd7b2 Compare October 30, 2024 14:54
@fabriziosestito fabriziosestito marked this pull request as ready for review October 30, 2024 15:04
Copy link
Member

@flavio flavio left a comment

Choose a reason for hiding this comment

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

Outstanding work! I left some comments

helm/templates/controller/role.yaml Show resolved Hide resolved
internal/controller/image_controller.go Show resolved Hide resolved
internal/storage/sbom_store.go Show resolved Hide resolved
internal/storage/sbom_store.go Show resolved Hide resolved
internal/storage/sbom_store.go Outdated Show resolved Hide resolved
internal/storage/sbom_store.go Show resolved Hide resolved
internal/storage/sbom_store_test.go Show resolved Hide resolved
internal/storage/sbom_store_test.go Show resolved Hide resolved
internal/storage/sbom_store_test.go Show resolved Hide resolved
internal/storage/sbom_store_test.go Show resolved Hide resolved
@fabriziosestito fabriziosestito force-pushed the feat/add-sbom-database-storage branch from e0fd7b2 to 25493dc Compare October 31, 2024 13:04
@fabriziosestito fabriziosestito force-pushed the feat/add-sbom-database-storage branch from 25493dc to ab02256 Compare October 31, 2024 13:06
Copy link
Member

@flavio flavio left a comment

Choose a reason for hiding this comment

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

LGTM, ship it :)

@fabriziosestito fabriziosestito merged commit 242e850 into rancher-sandbox:main Oct 31, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants