-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Add a transport package for clients #16126
Conversation
Labelling this PR as size/XXL |
GCE e2e test build/test passed for commit a89c002de780ce9b2844b5d266e17ed4426ba649. |
I skimmed and nothing jumped out at me. |
a89c002
to
e166499
Compare
I moved some unit tests over that I missed. I also changed the unversioned client to use the new transport. This breaks the build overall, but pkg/client/unversioned builds and passes tests locally. |
GCE e2e build/test failed for commit e16649968ddf25825cb2d7b514e70449b5f7365e. |
e166499
to
c156455
Compare
Moved more packages over... I'm probably going to rebase now and repush... build will likely still be broken until I track down all the uses of the old client config. |
GCE e2e build/test failed for commit c15645564051038bea9db3e27a48325f5c166cb9. |
c156455
to
07e8fcd
Compare
GCE e2e build/test failed for commit 07e8fcd9adecba1cb21dff9e71be37f2378dbfdd. |
07e8fcd
to
09be908
Compare
Ok this should be ready for a full review now. |
Let me know when you want me to squash... I hope the e2e passes 😄 |
Great. I'll take a look. Thanks. |
GCE e2e test build/test passed for commit 09be9089ffa20ced1f49dd025d8bfe5ca899176a. |
@karlkfi I couldn't figure out what was wrong with the latest mesos smoke test. Any ideas? |
@k8s-bot unit test this |
cc @lavalamp I think @caesarxuchao is unavailable today. |
cc @sttts for the last commit Thanks 😄 |
@k8s-bot unit test this |
Last change looks sensible. Let's wait for teamcity. |
} | ||
|
||
// Cache a single transport for these options | ||
c.transports[key] = &http.Transport{ |
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.
these defaults aren't equivalent to what we had before... it is not setting the same Dial
impl as the DefaultTransport
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.
Actually I missed that. sorry.
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.
Is there a reason not to use the same defaulting function as before, just setting the custom tlsConfig?
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.
Avoiding bloated util libraries to prevent needless dependencies. One of
the main overall goals of the client work is to make it easier for people
to import this.
On Nov 16, 2015 5:20 PM, "Jordan Liggitt" notifications@github.com wrote:
In pkg/client/transport/cache.go
#16126 (comment)
:
- if t, ok := c.transports[key]; ok {
return t, nil
- }
- // Get the TLS options for this client config
- tlsConfig, err := TLSConfigFor(config)
- if err != nil {
return nil, err
- }
- // The options didn't require a custom TLS config
- if tlsConfig == nil {
return http.DefaultTransport, nil
- }
- // Cache a single transport for these options
- c.transports[key] = &http.Transport{
Is there a reason not to use the same defaulting function as before, just
setting the custom tlsConfig?—
Reply to this email directly or view it on GitHub
https://github.com/kubernetes/kubernetes/pull/16126/files#r45010982.
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.
If anything, that function belongs in this package. Just don't want that code copied and pasted in lots of places again (for the exact reason that the refactor caused a behavior change...)
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.
Perhaps. It's really not that much code. And I don't want to add more to this PR.
when doing a big refactor like this, please call out subtle behavior changes like https://github.com/kubernetes/kubernetes/pull/16126/files#diff-0aac276a340a1b1786ed17ad728ddf99R62 or #16126 (diff) if they are intentional... |
9000353
to
4ac36a5
Compare
I rebased and fixed the issues you pointed out. The fixes are only in the last 3 commits, but they are all "new" commits because of a rebase. |
GCE e2e build/test failed for commit 4ac36a556deed64aceb2793d1dd39b758cb1861c. |
@k8s-bot test this please |
GCE e2e build/test failed for commit 4ac36a556deed64aceb2793d1dd39b758cb1861c. |
@k8s-bot e2e test this |
GCE e2e test build/test passed for commit 4ac36a556deed64aceb2793d1dd39b758cb1861c. |
GCE e2e test build/test passed for commit 4ac36a556deed64aceb2793d1dd39b758cb1861c. |
@liggitt Any other concerns? Should this be ok now? |
// BasicAuthConfig holds a username and password used for basic | ||
// authentication. | ||
type BasicAuthConfig struct { | ||
User string |
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.
nit, Username
to match existing field name, and to clarify it is a name, not a User object
@liggitt nit addressed |
GCE e2e test build/test passed for commit 5781f3ded5ba793bf7d4e8c6b777dba8958be450. |
@liggitt I moved the auth fields to the top level config. If this looks fine to you, I will squash for the merge. |
lgtm, squash away |
9898162
to
9b75b88
Compare
GCE e2e test build/test passed for commit 989816274a72d9ff6691dfe47bfc70531905a1fa. |
GCE e2e test build/test passed for commit 9b75b88. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit 9b75b88. |
Automatic merge from submit-queue |
Auto commit by PR queue bot
This is pulling the transport logic out of pkg/client/unversioned/[transport|helpers|debugging].go and completely replacing the utility function in pkg/client/unversioned/auth.
@kubernetes/goog-csi