Add String method to audit.Backend interface

Kubernetes-commit: 416a478cf6e4ea2aaecf5108aade563c9fc3fc53
This commit is contained in:
xuzhonghu 2018-07-18 17:35:08 +08:00 committed by Kubernetes Publisher
parent 563a7d9b06
commit bc8364d7ab
3 changed files with 11 additions and 0 deletions

View File

@ -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
}

View File

@ -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),

View File

@ -44,3 +44,7 @@ func (b *Backend) ProcessEvents(ev ...*auditinternal.Event) {
b.OnRequest(ev)
}
}
func (b *Backend) String() string {
return ""
}