mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 09:52:49 +00:00
Add String method to audit.Backend interface
This commit is contained in:
parent
a00e3748d4
commit
416a478cf6
@ -39,4 +39,7 @@ type Backend interface {
|
||||
// events are delivered. It can be assumed that this method is called after
|
||||
// the stopCh channel passed to the Run method has been closed.
|
||||
Shutdown()
|
||||
|
||||
// Returns the backend PluginName.
|
||||
String() string
|
||||
}
|
||||
|
@ -40,6 +40,10 @@ func (f *fakeBackend) Shutdown() {
|
||||
// Nothing to do here.
|
||||
}
|
||||
|
||||
func (f *fakeBackend) String() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func TestUnion(t *testing.T) {
|
||||
backends := []Backend{
|
||||
new(fakeBackend),
|
||||
|
@ -44,3 +44,7 @@ func (b *Backend) ProcessEvents(ev ...*auditinternal.Event) {
|
||||
b.OnRequest(ev)
|
||||
}
|
||||
}
|
||||
|
||||
func (b *Backend) String() string {
|
||||
return ""
|
||||
}
|
||||
|
@ -111,8 +111,14 @@ type auditSinkFunc func(events ...*auditinternal.Event)
|
||||
func (f auditSinkFunc) ProcessEvents(events ...*auditinternal.Event) {
|
||||
f(events...)
|
||||
}
|
||||
|
||||
func (auditSinkFunc) Run(stopCh <-chan struct{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (auditSinkFunc) Shutdown() {
|
||||
}
|
||||
|
||||
func (auditSinkFunc) String() string {
|
||||
return ""
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user