Skip to content
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

Merged
merged 1 commit into from
Dec 13, 2019

Conversation

novas0x2a
Copy link
Contributor

@novas0x2a novas0x2a commented Aug 22, 2019

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.

@GordonTheTurtle
Copy link

Please sign your commits following these rules:
/~https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ 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>
@codecov
Copy link

codecov bot commented Aug 22, 2019

Codecov Report

Merging #2985 into master will decrease coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            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
Flag Coverage Δ
#linux 60.64% <ø> (-0.05%) ⬇️
Impacted Files Coverage Δ
registry/handlers/app.go 48.16% <0%> (-0.7%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1fb7fff...c486db2. Read the comment docs.

@caervs caervs self-requested a review October 9, 2019 23:58
Copy link
Contributor

@caervs caervs left a 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.

@novas0x2a
Copy link
Contributor Author

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).

Copy link
Contributor

@caervs caervs left a 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.

@caervs caervs requested a review from dmcgowan October 21, 2019 17:57
@dmcgowan
Copy link
Collaborator

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

@dmcgowan dmcgowan merged commit bdf3438 into distribution:master Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants