Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
f0fdfd96
Commit
f0fdfd96
authored
Oct 06, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15101 from liggitt/kubelet_bearer_token
Auto commit by PR queue bot
parents
bc61bcc1
120e8727
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
helper.go
pkg/client/unversioned/helper.go
+3
-0
kubelet.go
pkg/client/unversioned/kubelet.go
+10
-4
No files found.
pkg/client/unversioned/helper.go
View file @
f0fdfd96
...
@@ -100,6 +100,9 @@ type KubeletConfig struct {
...
@@ -100,6 +100,9 @@ type KubeletConfig struct {
// TLSClientConfig contains settings to enable transport layer security
// TLSClientConfig contains settings to enable transport layer security
TLSClientConfig
TLSClientConfig
// Server requires Bearer authentication
BearerToken
string
// HTTPTimeout is used by the client to timeout http requests to Kubelet.
// HTTPTimeout is used by the client to timeout http requests to Kubelet.
HTTPTimeout
time
.
Duration
HTTPTimeout
time
.
Duration
...
...
pkg/client/unversioned/kubelet.go
View file @
f0fdfd96
...
@@ -50,14 +50,20 @@ func MakeTransport(config *KubeletConfig) (http.RoundTripper, error) {
...
@@ -50,14 +50,20 @@ func MakeTransport(config *KubeletConfig) (http.RoundTripper, error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
transport
:=
http
.
DefaultTransport
if
config
.
Dial
!=
nil
||
tlsConfig
!=
nil
{
if
config
.
Dial
!=
nil
||
tlsConfig
!=
nil
{
return
util
.
SetTransportDefaults
(
&
http
.
Transport
{
transport
=
util
.
SetTransportDefaults
(
&
http
.
Transport
{
Dial
:
config
.
Dial
,
Dial
:
config
.
Dial
,
TLSClientConfig
:
tlsConfig
,
TLSClientConfig
:
tlsConfig
,
}),
nil
})
}
else
{
}
return
http
.
DefaultTransport
,
nil
if
len
(
config
.
BearerToken
)
>
0
{
transport
=
NewBearerAuthRoundTripper
(
config
.
BearerToken
,
transport
)
}
}
return
transport
,
nil
}
}
// TODO: this structure is questionable, it should be using client.Config and overriding defaults.
// TODO: this structure is questionable, it should be using client.Config and overriding defaults.
...
...
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