You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Writer begins or resumes the active writer identified by descfunc (s*hybridStore) Writer(ctx context.Context, opts...content.WriterOpt) (content.Writer, error) {
varwOpts content.WriterOptsfor_, opt:=rangeopts {
iferr:=opt(&wOpts); err!=nil {
returnnil, err
}
}
ifisAllowedMediaType(wOpts.Desc.MediaType, ocispec.MediaTypeImageManifest, ocispec.MediaTypeImageIndex) ||s.ingester==nil {
returns.cache.Writer(ctx, opts...)
}
returns.ingester.Writer(ctx, opts...)
}
If the media type is a manifest or an index, it stores it in the cache - which can be a good thing, especially when the need to walk children comes about - but it doesn't pass it through to the ingester, as s.cache is just a MemoryStore.
Why would we want only to send the config and layers (and whatever other media types there are) through to the ingester? We don't know how it uses it, shouldn't it be up to the ingester to decide?
Strangely, I have had this work, so maybe I am missing something, or maybe it didn't work and I didn't fully realize it?
I would be fine with an an additional option such as WithCachedMediaTypes that allows you to supply your own, defaulting to []string{wOpts.Desc.MediaType, ocispec.MediaTypeImageManifest, ocispec.MediaTypeImageIndex}
Looking at this code here:
If the media type is a manifest or an index, it stores it in the cache - which can be a good thing, especially when the need to walk children comes about - but it doesn't pass it through to the ingester, as
s.cache
is just aMemoryStore
.Why would we want only to send the config and layers (and whatever other media types there are) through to the ingester? We don't know how it uses it, shouldn't it be up to the ingester to decide?
Strangely, I have had this work, so maybe I am missing something, or maybe it didn't work and I didn't fully realize it?
cc @jdolitsky @shizhMSFT
The text was updated successfully, but these errors were encountered: