Add WithMetaStore to overlay snapshotter to allow bringing your own#8945
Conversation
|
Hi @rbpdt. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
5dc9146 to
c34a818
Compare
3813f14 to
6f90c25
Compare
snapshots/overlay/overlay.go
Outdated
|
|
||
| // WithMetaStore allows the MetaStore to be created outside the snapshotter | ||
| // and passed in. | ||
| func WithMetaStore(ms *storage.MetaStore) Opt { |
There was a problem hiding this comment.
Directory structure managed by overlayfs snapshotter (e.g. upperPath()) should also be observed by remote snapshotter. Otherwize remote snapshotter needs to be implemented with assuming the directory structure and possibly can't notice the changes on the structure when bumping up the imports.
There was a problem hiding this comment.
Are you suggesting we make upperPath and workPath public, which means we’ll also have to make the snapshotter struct public?
snapshots/overlay/overlay.go
Outdated
|
|
||
| // WithMetaStore allows the MetaStore to be created outside the snapshotter | ||
| // and passed in. | ||
| func WithMetaStore(ms *storage.MetaStore) Opt { |
There was a problem hiding this comment.
We can avoid using a pointer to a struct here and pass in an interface. The interface is small and could just be added right before the function (to define the interface in package it is used in).
type MetaStore interface {
TransactionContext(ctx context.Context, writable bool) (context.Context, storage.Transactor, error)
Close() error
}
There was a problem hiding this comment.
I think the interface may also need withTransaction? But yes, I think this is a good idea.
Signed-off-by: Robbie Buxton <138501839+rbpdt@users.noreply.github.com>
6f90c25 to
23c9535
Compare
…lay-snapshotter-embeddable Add WithMetaStore to overlay snapshotter to allow bringing your own
Added the option to pass a metastore to the overlay snapshotter as an opt to allow for easier embedding in other overlay-based snapshotter projects like stargz
#8959