-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Allow to use repo middleware wrapper during cross-repo mounts #1757
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
Allow to use repo middleware wrapper during cross-repo mounts #1757
Conversation
hi @miminar is your change to linkedBlobStore (changing the embedded type to an interface) enough to allow you to get your behavior purely though the middleware system? i.e. you can use linkedBlob store with your own registry / repository types created via RegistryMiddlware? |
@RichardScothern Might be interesting to look for a solution that integrates the existing proxy support, as that is very similar to the request. Although, I don't know that code well enough to provide a suggestion. |
I don't see any other way of controlling blob mounting functionality without a change like this. Blob mounting and the linked blob store are closely coupled. Using the term middleware to describe an override function like this is a bit confusing. Perhaps allowing a Create method to be passed into the linkedBlob store would be cleaner? @miminar are you able to use any of the proxy functionality for your needs? |
Thanks for your suggestions!
Yes, I've already tested it.
We don't use distribution's proxy code. I believe we could use it in our blob store middleware for remote queries, but it doesn't address our problem. We can
I don't understand your suggestion. Our If we pass our So the smallest change that would allow us to handle the mountFrom is just exporting
Would |
@RichardScothern bump :) |
hi sorry @miminar and @mfojtik, I was on holiday and forgot about this one. Reading back through the comments I think perhaps it would be easier to just export |
@RichardScothern awesome, I agree. |
0a38172
to
0bad0c6
Compare
Current coverage is 52.53%@@ master #1757 diff @@
==========================================
Files 120 120
Lines 10477 10467 -10
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 6220 5499 -721
- Misses 3425 4230 +805
+ Partials 832 738 -94
|
0bad0c6
to
e38248a
Compare
Let the options for `BlobStore.Create()` be modified in middleware wrappers. Signed-off-by: Michal Minar <[email protected]>
e38248a
to
3f14345
Compare
@RichardScothern What do you think about this now ? |
LGTM. |
@RichardScothern thanks! |
The |
In OpenShift, there's a
pullthroughBlobStore
middleware wrapper that acts like a proxy. It allows to pull blobs from remote registries based on per-repository configuration stored in etcd.We definitely want to utilize the cross-repository mount functionality where the blob existing in other repository (in this case a remote registry) is mounted/linked into the target one if the client knows about it.
With this mount functionality working for the remote blobs, the registry won't store them on local storage. Which is what we aim for.
This PR allows to pass repository middleware wrapper to the
Create()
method oflinkedBlobsStore()
as an option. The method then calls it in order toStat()
the blob in the source repository.Maybe there's a less intrusive way to achieve the same, please let me know if you have better idea.
/cc @stevvooe, @RichardScothern