store: Remove dynamic abstraction#1518
Conversation
A while ago we added a trait in preparation for multiple backends.
The current composefs branch ignores it and has a bunch of
`if {} else {}`.
Looking at this, what I think will work better in the end is
actually a more refined version of the `if {} else {}` model
instead of trying to really flesh out this trait. It's
hard to say of course until we get there, but the trait
approach forces a high level of abstraction vs just trying
to factor out common code between two backends.
Signed-off-by: Colin Walters <walters@verbum.org>
5516525 to
82057f8
Compare
There was a problem hiding this comment.
Code Review
This pull request is a refactoring that removes the dynamic abstraction for storage backends, specifically the ContainerImageStore and ContainerImageStoreImpl traits. The logic from the sole implementation, OstreeContainerStore, has been moved into crates/lib/src/status.rs, and the crates/lib/src/store/ostree_container.rs file has been deleted. This change simplifies the codebase by removing a layer of indirection that is no longer deemed necessary, in line with the reasoning provided in the pull request description. The changes are clean, well-executed, and improve code clarity. I have no further comments or suggestions.
jeckersb
left a comment
There was a problem hiding this comment.
👍
yeah the backend thing never really panned out, this definitely makes things a lot simpler
A while ago we added a trait in preparation for multiple backends. The current composefs branch ignores it and has a bunch of
if {} else {}.Looking at this, what I think will work better in the end is actually a more refined version of the
if {} else {}model instead of trying to really flesh out this trait. It's hard to say of course until we get there, but the trait approach forces a high level of abstraction vs just trying to factor out common code between two backends.