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
9fb4a2aa
Unverified
Commit
9fb4a2aa
authored
Oct 22, 2018
by
k8s-ci-robot
Committed by
GitHub
Oct 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #70060 from pbarker/audit-webhook
updates shared apiserver webhook client
parents
1af393d5
5874a1f8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
client.go
staging/src/k8s.io/apiserver/pkg/util/webhook/client.go
+3
-3
error.go
staging/src/k8s.io/apiserver/pkg/util/webhook/error.go
+2
-2
webhook.go
staging/src/k8s.io/apiserver/pkg/util/webhook/webhook.go
+2
-2
No files found.
staging/src/k8s.io/apiserver/pkg/util/webhook/client.go
View file @
9fb4a2aa
...
...
@@ -66,14 +66,14 @@ func NewClientManager(gv schema.GroupVersion, addToSchemaFunc func(s *runtime.Sc
if
err
!=
nil
{
return
ClientManager
{},
err
}
admission
Scheme
:=
runtime
.
NewScheme
()
if
err
:=
addToSchemaFunc
(
admission
Scheme
);
err
!=
nil
{
hook
Scheme
:=
runtime
.
NewScheme
()
if
err
:=
addToSchemaFunc
(
hook
Scheme
);
err
!=
nil
{
return
ClientManager
{},
err
}
return
ClientManager
{
cache
:
cache
,
negotiatedSerializer
:
serializer
.
NegotiatedSerializerWrapper
(
runtime
.
SerializerInfo
{
Serializer
:
serializer
.
NewCodecFactory
(
admission
Scheme
)
.
LegacyCodec
(
gv
),
Serializer
:
serializer
.
NewCodecFactory
(
hook
Scheme
)
.
LegacyCodec
(
gv
),
}),
},
nil
}
...
...
staging/src/k8s.io/apiserver/pkg/util/webhook/error.go
View file @
9fb4a2aa
...
...
@@ -28,7 +28,7 @@ type ErrCallingWebhook struct {
func
(
e
*
ErrCallingWebhook
)
Error
()
string
{
if
e
.
Reason
!=
nil
{
return
fmt
.
Sprintf
(
"failed calling
admission
webhook %q: %v"
,
e
.
WebhookName
,
e
.
Reason
)
return
fmt
.
Sprintf
(
"failed calling webhook %q: %v"
,
e
.
WebhookName
,
e
.
Reason
)
}
return
fmt
.
Sprintf
(
"failed calling
admission
webhook %q; no further details available"
,
e
.
WebhookName
)
return
fmt
.
Sprintf
(
"failed calling webhook %q; no further details available"
,
e
.
WebhookName
)
}
staging/src/k8s.io/apiserver/pkg/util/webhook/webhook.go
View file @
9fb4a2aa
...
...
@@ -37,7 +37,7 @@ const defaultRequestTimeout = 30 * time.Second
type
GenericWebhook
struct
{
RestClient
*
rest
.
RESTClient
i
nitialBackoff
time
.
Duration
I
nitialBackoff
time
.
Duration
}
// NewGenericWebhook creates a new GenericWebhook from the provided kubeconfig file.
...
...
@@ -83,7 +83,7 @@ func newGenericWebhook(scheme *runtime.Scheme, codecFactory serializer.CodecFact
// it returns an error for which apierrors.SuggestsClientDelay() or apierrors.IsInternalError() returns true.
func
(
g
*
GenericWebhook
)
WithExponentialBackoff
(
webhookFn
func
()
rest
.
Result
)
rest
.
Result
{
var
result
rest
.
Result
WithExponentialBackoff
(
g
.
i
nitialBackoff
,
func
()
error
{
WithExponentialBackoff
(
g
.
I
nitialBackoff
,
func
()
error
{
result
=
webhookFn
()
return
result
.
Error
()
})
...
...
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