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
54c883f2
Unverified
Commit
54c883f2
authored
Apr 17, 2018
by
Jordan Liggitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Honor existing CA bundle and TLS server name in webhook client
parent
6f657424
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
client.go
...o/apiserver/pkg/admission/plugin/webhook/config/client.go
+10
-2
No files found.
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/config/client.go
View file @
54c883f2
...
@@ -113,7 +113,12 @@ func (cm *ClientManager) HookClient(h *v1beta1.Webhook) (*rest.RESTClient, error
...
@@ -113,7 +113,12 @@ func (cm *ClientManager) HookClient(h *v1beta1.Webhook) (*rest.RESTClient, error
}
}
complete
:=
func
(
cfg
*
rest
.
Config
)
(
*
rest
.
RESTClient
,
error
)
{
complete
:=
func
(
cfg
*
rest
.
Config
)
(
*
rest
.
RESTClient
,
error
)
{
cfg
.
TLSClientConfig
.
CAData
=
h
.
ClientConfig
.
CABundle
// Combine CAData from the config with any existing CA bundle provided
if
len
(
cfg
.
TLSClientConfig
.
CAData
)
>
0
{
cfg
.
TLSClientConfig
.
CAData
=
append
(
cfg
.
TLSClientConfig
.
CAData
,
'\n'
)
}
cfg
.
TLSClientConfig
.
CAData
=
append
(
cfg
.
TLSClientConfig
.
CAData
,
h
.
ClientConfig
.
CABundle
...
)
cfg
.
ContentConfig
.
NegotiatedSerializer
=
cm
.
negotiatedSerializer
cfg
.
ContentConfig
.
NegotiatedSerializer
=
cm
.
negotiatedSerializer
cfg
.
ContentConfig
.
ContentType
=
runtime
.
ContentTypeJSON
cfg
.
ContentConfig
.
ContentType
=
runtime
.
ContentTypeJSON
client
,
err
:=
rest
.
UnversionedRESTClientFor
(
cfg
)
client
,
err
:=
rest
.
UnversionedRESTClientFor
(
cfg
)
...
@@ -135,7 +140,10 @@ func (cm *ClientManager) HookClient(h *v1beta1.Webhook) (*rest.RESTClient, error
...
@@ -135,7 +140,10 @@ func (cm *ClientManager) HookClient(h *v1beta1.Webhook) (*rest.RESTClient, error
if
svc
.
Path
!=
nil
{
if
svc
.
Path
!=
nil
{
cfg
.
APIPath
=
*
svc
.
Path
cfg
.
APIPath
=
*
svc
.
Path
}
}
cfg
.
TLSClientConfig
.
ServerName
=
serverName
// Set the server name if not already set
if
len
(
cfg
.
TLSClientConfig
.
ServerName
)
==
0
{
cfg
.
TLSClientConfig
.
ServerName
=
serverName
}
delegateDialer
:=
cfg
.
Dial
delegateDialer
:=
cfg
.
Dial
if
delegateDialer
==
nil
{
if
delegateDialer
==
nil
{
...
...
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