Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
38c77e0f
Commit
38c77e0f
authored
Jan 14, 2017
by
Eric Chiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage/kubernetes: enable HTTP/2 support
parent
bb896a82
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
client.go
storage/kubernetes/client.go
+12
-1
No files found.
storage/kubernetes/client.go
View file @
38c77e0f
...
...
@@ -25,6 +25,7 @@ import (
"github.com/ghodss/yaml"
"github.com/gtank/cryptopasta"
"golang.org/x/net/context"
"golang.org/x/net/http2"
"github.com/coreos/dex/storage"
"github.com/coreos/dex/storage/kubernetes/k8sapi"
...
...
@@ -285,7 +286,8 @@ func newClient(cluster k8sapi.Cluster, user k8sapi.AuthInfo, namespace string, l
tlsConfig
.
Certificates
=
[]
tls
.
Certificate
{
cert
}
}
var
t
http
.
RoundTripper
=
&
http
.
Transport
{
var
t
http
.
RoundTripper
httpTransport
:=
&
http
.
Transport
{
Proxy
:
http
.
ProxyFromEnvironment
,
Dial
:
(
&
net
.
Dialer
{
Timeout
:
30
*
time
.
Second
,
...
...
@@ -296,6 +298,15 @@ func newClient(cluster k8sapi.Cluster, user k8sapi.AuthInfo, namespace string, l
ExpectContinueTimeout
:
1
*
time
.
Second
,
}
// Since we set a custom TLS client config we have to explicitly
// enable HTTP/2.
//
// https://github.com/golang/go/blob/go1.7.4/src/net/http/transport.go#L200-L206
if
err
:=
http2
.
ConfigureTransport
(
httpTransport
);
err
!=
nil
{
return
nil
,
err
}
t
=
httpTransport
if
user
.
Token
!=
""
{
t
=
transport
{
updateReq
:
func
(
r
*
http
.
Request
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment