-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
make it possible to wrap the client transport in another one #2985
Conversation
Please sign your commits following these rules: $ git clone -b "default-transport" git@github.com:novas0x2a/distribution.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f Amending updates the existing PR. You DO NOT need to open a new one. |
Signed-off-by: Mike Lundy <mike@fluffypenguin.org>
3054811
to
c486db2
Compare
Codecov Report
@@ Coverage Diff @@
## master #2985 +/- ##
==========================================
- Coverage 60.69% 60.64% -0.05%
==========================================
Files 102 102
Lines 8044 8044
==========================================
- Hits 4882 4878 -4
- Misses 2511 2514 +3
- Partials 651 652 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @novas0x2a. Sorry it has taken us so long to get to this one.
Can you tell me why it's not sufficient to pass in your round tripper as the base
for NewTransport
? I know that would wrap your roundtripper instead of the other way around, but I think it'd suffice for the cases you bring up.
Sorry, I guess I didn't motivate the change enough; I was looking for a more centralized, less-invasive-and-api-breaking method to add context awareness to things like NewV2Repository which doesn't let me pass a transport in. (I readily agree that my method is not ideal, just not sure what else to do about it, heh). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. Works for me. LGTM.
We are trying to deprecate this implementation in favor of the client implementation in containerd. I don't have a better suggestion for how to achieve that in this code base though, I think updating it is fine for now. LGTM |
When using the client, I'd like to modify the behavior somewhat (retries, context-aware, etc). This would allow me to interject a transport to handle that; I'm not set on this impl, though, and I'd do it differently if you'd prefer that. Putting this up as a feeler.