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

Add a transport package for clients #16126

Merged
merged 1 commit into from
Nov 20, 2015

Conversation

krousey
Copy link
Contributor

@krousey krousey commented Oct 22, 2015

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

@k8s-github-robot k8s-github-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 22, 2015
@k8s-github-robot
Copy link

Labelling this PR as size/XXL

@k8s-bot
Copy link

k8s-bot commented Oct 22, 2015

GCE e2e test build/test passed for commit a89c002de780ce9b2844b5d266e17ed4426ba649.

@lavalamp lavalamp assigned caesarxuchao and unassigned lavalamp Oct 22, 2015
@lavalamp
Copy link
Member

I skimmed and nothing jumped out at me.

@krousey
Copy link
Contributor Author

krousey commented Oct 26, 2015

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.

@k8s-bot
Copy link

k8s-bot commented Oct 26, 2015

GCE e2e build/test failed for commit e16649968ddf25825cb2d7b514e70449b5f7365e.

@krousey
Copy link
Contributor Author

krousey commented Oct 27, 2015

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.

@k8s-bot
Copy link

k8s-bot commented Oct 27, 2015

GCE e2e build/test failed for commit c15645564051038bea9db3e27a48325f5c166cb9.

@k8s-bot
Copy link

k8s-bot commented Oct 27, 2015

GCE e2e build/test failed for commit 07e8fcd9adecba1cb21dff9e71be37f2378dbfdd.

@krousey
Copy link
Contributor Author

krousey commented Oct 28, 2015

Ok this should be ready for a full review now.

@krousey krousey changed the title [WIP] Add a transport package for clients Add a transport package for clients Oct 28, 2015
@krousey
Copy link
Contributor Author

krousey commented Oct 28, 2015

Let me know when you want me to squash... I hope the e2e passes 😄

@caesarxuchao
Copy link
Member

Great. I'll take a look. Thanks.

@k8s-bot
Copy link

k8s-bot commented Oct 28, 2015

GCE e2e test build/test passed for commit 09be9089ffa20ced1f49dd025d8bfe5ca899176a.

@krousey
Copy link
Contributor Author

krousey commented Oct 28, 2015

@karlkfi I couldn't figure out what was wrong with the latest mesos smoke test. Any ideas?

@krousey
Copy link
Contributor Author

krousey commented Oct 28, 2015

@k8s-bot unit test this

@krousey
Copy link
Contributor Author

krousey commented Oct 28, 2015

cc @lavalamp I think @caesarxuchao is unavailable today.

@krousey
Copy link
Contributor Author

krousey commented Oct 28, 2015

cc @sttts for the last commit

Thanks 😄

@krousey
Copy link
Contributor Author

krousey commented Oct 28, 2015

@k8s-bot unit test this

@sttts
Copy link
Contributor

sttts commented Oct 28, 2015

Last change looks sensible. Let's wait for teamcity.

}

// Cache a single transport for these options
c.transports[key] = &http.Transport{
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Contributor Author

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.

@liggitt
Copy link
Member

liggitt commented Nov 16, 2015

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

@krousey
Copy link
Contributor Author

krousey commented Nov 16, 2015

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.

@k8s-bot
Copy link

k8s-bot commented Nov 16, 2015

GCE e2e build/test failed for commit 4ac36a556deed64aceb2793d1dd39b758cb1861c.

@krousey
Copy link
Contributor Author

krousey commented Nov 17, 2015

@k8s-bot test this please

@k8s-bot
Copy link

k8s-bot commented Nov 17, 2015

GCE e2e build/test failed for commit 4ac36a556deed64aceb2793d1dd39b758cb1861c.

@krousey
Copy link
Contributor Author

krousey commented Nov 17, 2015

@k8s-bot e2e test this

@k8s-bot
Copy link

k8s-bot commented Nov 17, 2015

GCE e2e test build/test passed for commit 4ac36a556deed64aceb2793d1dd39b758cb1861c.

@k8s-bot
Copy link

k8s-bot commented Nov 18, 2015

GCE e2e test build/test passed for commit 4ac36a556deed64aceb2793d1dd39b758cb1861c.

@krousey
Copy link
Contributor Author

krousey commented Nov 19, 2015

@liggitt Any other concerns?

Should this be ok now?

cc @caesarxuchao

// BasicAuthConfig holds a username and password used for basic
// authentication.
type BasicAuthConfig struct {
User string
Copy link
Member

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

@krousey
Copy link
Contributor Author

krousey commented Nov 19, 2015

@liggitt nit addressed

@k8s-bot
Copy link

k8s-bot commented Nov 19, 2015

GCE e2e test build/test passed for commit 5781f3ded5ba793bf7d4e8c6b777dba8958be450.

@krousey
Copy link
Contributor Author

krousey commented Nov 19, 2015

@liggitt I moved the auth fields to the top level config. If this looks fine to you, I will squash for the merge.

@liggitt
Copy link
Member

liggitt commented Nov 19, 2015

lgtm, squash away

@caesarxuchao
Copy link
Member

Thanks @liggitt @krousey. LGTM.

Please add the LGTM label yourself after squash :)

@krousey krousey added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 19, 2015
@k8s-bot
Copy link

k8s-bot commented Nov 19, 2015

GCE e2e test build/test passed for commit 989816274a72d9ff6691dfe47bfc70531905a1fa.

@k8s-bot
Copy link

k8s-bot commented Nov 19, 2015

GCE e2e test build/test passed for commit 9b75b88.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Nov 20, 2015

GCE e2e test build/test passed for commit 9b75b88.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants