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
416a478c
Commit
416a478c
authored
Jul 18, 2018
by
xuzhonghu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add String method to audit.Backend interface
parent
a00e3748
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
0 deletions
+17
-0
types.go
staging/src/k8s.io/apiserver/pkg/audit/types.go
+3
-0
union_test.go
staging/src/k8s.io/apiserver/pkg/audit/union_test.go
+4
-0
fake.go
staging/src/k8s.io/apiserver/plugin/pkg/audit/fake/fake.go
+4
-0
webhook_test.go
test/integration/examples/webhook_test.go
+6
-0
No files found.
staging/src/k8s.io/apiserver/pkg/audit/types.go
View file @
416a478c
...
@@ -39,4 +39,7 @@ type Backend interface {
...
@@ -39,4 +39,7 @@ type Backend interface {
// events are delivered. It can be assumed that this method is called after
// events are delivered. It can be assumed that this method is called after
// the stopCh channel passed to the Run method has been closed.
// the stopCh channel passed to the Run method has been closed.
Shutdown
()
Shutdown
()
// Returns the backend PluginName.
String
()
string
}
}
staging/src/k8s.io/apiserver/pkg/audit/union_test.go
View file @
416a478c
...
@@ -40,6 +40,10 @@ func (f *fakeBackend) Shutdown() {
...
@@ -40,6 +40,10 @@ func (f *fakeBackend) Shutdown() {
// Nothing to do here.
// Nothing to do here.
}
}
func
(
f
*
fakeBackend
)
String
()
string
{
return
""
}
func
TestUnion
(
t
*
testing
.
T
)
{
func
TestUnion
(
t
*
testing
.
T
)
{
backends
:=
[]
Backend
{
backends
:=
[]
Backend
{
new
(
fakeBackend
),
new
(
fakeBackend
),
...
...
staging/src/k8s.io/apiserver/plugin/pkg/audit/fake/fake.go
View file @
416a478c
...
@@ -44,3 +44,7 @@ func (b *Backend) ProcessEvents(ev ...*auditinternal.Event) {
...
@@ -44,3 +44,7 @@ func (b *Backend) ProcessEvents(ev ...*auditinternal.Event) {
b
.
OnRequest
(
ev
)
b
.
OnRequest
(
ev
)
}
}
}
}
func
(
b
*
Backend
)
String
()
string
{
return
""
}
test/integration/examples/webhook_test.go
View file @
416a478c
...
@@ -111,8 +111,14 @@ type auditSinkFunc func(events ...*auditinternal.Event)
...
@@ -111,8 +111,14 @@ type auditSinkFunc func(events ...*auditinternal.Event)
func
(
f
auditSinkFunc
)
ProcessEvents
(
events
...*
auditinternal
.
Event
)
{
func
(
f
auditSinkFunc
)
ProcessEvents
(
events
...*
auditinternal
.
Event
)
{
f
(
events
...
)
f
(
events
...
)
}
}
func
(
auditSinkFunc
)
Run
(
stopCh
<-
chan
struct
{})
error
{
func
(
auditSinkFunc
)
Run
(
stopCh
<-
chan
struct
{})
error
{
return
nil
return
nil
}
}
func
(
auditSinkFunc
)
Shutdown
()
{
func
(
auditSinkFunc
)
Shutdown
()
{
}
}
func
(
auditSinkFunc
)
String
()
string
{
return
""
}
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