Open tianon opened 4 months ago
Good idea. I think the API outline described in issue #23 should be sufficient for adding that degree of freedom in ocimem
.
There are a bunch of possibilities for how much flexibility to provide there though, ranging from a simple StrictReferences
boolean to some kind of arbitrary function that's used to query whether a given operation should be allowed.
What might be your preference there?
Oh interesting - I like the idea of a function that gets to choose or do more extensive validation of some kind, but I'm totally fine with just a boolean for my own use case. I guess it depends on how much you want ocimem
to scope creep :sweat_smile:
I wanted to use
ocimem
as a very rudimentary cache on top of an existing registry (was actually building a fullociregistry.Interface
that does so transparently :smile:) and ran into the unfortunate limitation thatocimem
enforces fully valid/"fat" manifests:https://github.com/cue-labs/oci/blob/1f693b7466afbd2989a1bdbc88b4c33e5c550472/ociregistry/ocimem/writer.go#L188-L199
It'd be interesting/useful if
ocimem
could have a way to optionally enable a "sparse" mode that relaxes that restriction. :eyes: