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 an (optional) proxy to the TLS config. #4278

Merged
merged 1 commit into from
Feb 19, 2015

Conversation

brendandburns
Copy link
Contributor

Also fill in some other reasonable defaults.

Also fill in some other reasonable defaults.
@@ -228,6 +230,12 @@ func TransportFor(config *Config) (http.RoundTripper, error) {
if tlsConfig != nil {
transport = &http.Transport{
TLSClientConfig: tlsConfig,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the exact same parameters that are in http.DefaultTransport. If you just add the TLSClientConfig to the DefaultTransport will that cause it to be applied elsewhere that we want to use the DefaultTransport (and if so, then using DefaultTransport anywhere seems like a terrible idea since it's a global variable).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would probably be better to copy the http.DefaultTransform's fields (if these are truly the same) rather than add the new ones.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From http://golang.org/pkg/net/http/:

var DefaultTransport RoundTripper = &Transport{
Proxy: ProxyFromEnvironment,
Dial: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}).Dial,
TLSHandshakeTimeout: 10 * time.Second,
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would probably be better for us to copy the attributes we want:

&Transport{
  Proxy: http.DefaultTransport.Proxy,
  Dial: http.DefaultTransport.Dial,
  TLSHandshakeTimeout: http.DefaultTransport.TLSHandshakeTimeout,
}

We can't copy the transport without sharing its pool which is verboten (i believe)

----- Original Message -----

@@ -228,6 +230,12 @@ func TransportFor(config *Config) (http.RoundTripper,
error) {
if tlsConfig != nil {
transport = &http.Transport{
TLSClientConfig: tlsConfig,

From http://golang.org/pkg/net/http/:

var DefaultTransport RoundTripper = &Transport{
Proxy: ProxyFromEnvironment,
Dial: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}).Dial,
TLSHandshakeTimeout: 10 * time.Second,
}


Reply to this email directly or view it on GitHub:
https://github.com/GoogleCloudPlatform/kubernetes/pull/4278/files#r24562008

@roberthbailey roberthbailey self-assigned this Feb 10, 2015
@brendandburns
Copy link
Contributor Author

Sadly http.DefaultTransport is type http.RoundTripper and thus we lose access to reference all of the fields within it. So I think this is the best we can do.

--brendan

@roberthbailey
Copy link
Contributor

In that case, this is better than what we have so LGTM. Will merge in the morning.

@roberthbailey roberthbailey added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 19, 2015
roberthbailey added a commit that referenced this pull request Feb 19, 2015
Add an (optional) proxy to the TLS config.
@roberthbailey roberthbailey merged commit bab8393 into kubernetes:master Feb 19, 2015
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants