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
5bc5cd1b
Commit
5bc5cd1b
authored
Mar 10, 2018
by
Cao Shufeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix option --audit-webhook-initial-backoff
Before this change, --audit-webhook-initial-backoff has no effect
parent
c6ae1e51
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
audit.go
staging/src/k8s.io/apiserver/pkg/server/options/audit.go
+1
-1
webhook.go
.../src/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook.go
+2
-2
webhook_test.go
...k8s.io/apiserver/plugin/pkg/audit/webhook/webhook_test.go
+1
-1
No files found.
staging/src/k8s.io/apiserver/pkg/server/options/audit.go
View file @
5bc5cd1b
...
@@ -364,7 +364,7 @@ func (o *AuditWebhookOptions) applyTo(c *server.Config) error {
...
@@ -364,7 +364,7 @@ func (o *AuditWebhookOptions) applyTo(c *server.Config) error {
return
nil
return
nil
}
}
webhook
,
err
:=
pluginwebhook
.
NewBackend
(
o
.
ConfigFile
,
auditv1beta1
.
SchemeGroupVersion
)
webhook
,
err
:=
pluginwebhook
.
NewBackend
(
o
.
ConfigFile
,
auditv1beta1
.
SchemeGroupVersion
,
o
.
InitialBackoff
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"initializing audit webhook: %v"
,
err
)
return
fmt
.
Errorf
(
"initializing audit webhook: %v"
,
err
)
}
}
...
...
staging/src/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook.go
View file @
5bc5cd1b
...
@@ -70,8 +70,8 @@ type backend struct {
...
@@ -70,8 +70,8 @@ type backend struct {
}
}
// NewBackend returns an audit backend that sends events over HTTP to an external service.
// NewBackend returns an audit backend that sends events over HTTP to an external service.
func
NewBackend
(
kubeConfigFile
string
,
groupVersion
schema
.
GroupVersion
)
(
audit
.
Backend
,
error
)
{
func
NewBackend
(
kubeConfigFile
string
,
groupVersion
schema
.
GroupVersion
,
initialBackoff
time
.
Duration
)
(
audit
.
Backend
,
error
)
{
w
,
err
:=
loadWebhook
(
kubeConfigFile
,
groupVersion
,
DefaultI
nitialBackoff
)
w
,
err
:=
loadWebhook
(
kubeConfigFile
,
groupVersion
,
i
nitialBackoff
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
staging/src/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook_test.go
View file @
5bc5cd1b
...
@@ -105,7 +105,7 @@ func newWebhook(t *testing.T, endpoint string, groupVersion schema.GroupVersion)
...
@@ -105,7 +105,7 @@ func newWebhook(t *testing.T, endpoint string, groupVersion schema.GroupVersion)
// NOTE(ericchiang): Do we need to use a proper serializer?
// NOTE(ericchiang): Do we need to use a proper serializer?
require
.
NoError
(
t
,
stdjson
.
NewEncoder
(
f
)
.
Encode
(
config
),
"writing kubeconfig"
)
require
.
NoError
(
t
,
stdjson
.
NewEncoder
(
f
)
.
Encode
(
config
),
"writing kubeconfig"
)
b
,
err
:=
NewBackend
(
f
.
Name
(),
groupVersion
)
b
,
err
:=
NewBackend
(
f
.
Name
(),
groupVersion
,
DefaultInitialBackoff
)
require
.
NoError
(
t
,
err
,
"initializing backend"
)
require
.
NoError
(
t
,
err
,
"initializing backend"
)
return
b
.
(
*
backend
)
return
b
.
(
*
backend
)
...
...
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