diff --git a/staging/src/k8s.io/apiserver/pkg/audit/types.go b/staging/src/k8s.io/apiserver/pkg/audit/types.go index f1b7cef5457..dbf03b0f51c 100644 --- a/staging/src/k8s.io/apiserver/pkg/audit/types.go +++ b/staging/src/k8s.io/apiserver/pkg/audit/types.go @@ -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 } diff --git a/staging/src/k8s.io/apiserver/pkg/audit/union_test.go b/staging/src/k8s.io/apiserver/pkg/audit/union_test.go index 45fd6710035..3d474a4743c 100644 --- a/staging/src/k8s.io/apiserver/pkg/audit/union_test.go +++ b/staging/src/k8s.io/apiserver/pkg/audit/union_test.go @@ -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), diff --git a/staging/src/k8s.io/apiserver/plugin/pkg/audit/fake/fake.go b/staging/src/k8s.io/apiserver/plugin/pkg/audit/fake/fake.go index 4b8fa3c7c21..a886529ec68 100644 --- a/staging/src/k8s.io/apiserver/plugin/pkg/audit/fake/fake.go +++ b/staging/src/k8s.io/apiserver/plugin/pkg/audit/fake/fake.go @@ -44,3 +44,7 @@ func (b *Backend) ProcessEvents(ev ...*auditinternal.Event) { b.OnRequest(ev) } } + +func (b *Backend) String() string { + return "" +} diff --git a/test/integration/examples/webhook_test.go b/test/integration/examples/webhook_test.go index f756d06d4ce..eb4d04fd30b 100644 --- a/test/integration/examples/webhook_test.go +++ b/test/integration/examples/webhook_test.go @@ -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 "" +}