From 3039935d60d325977e77bc333e64062106b1dad5 Mon Sep 17 00:00:00 2001 From: Patrick Barker Date: Tue, 16 Oct 2018 16:17:33 -0600 Subject: [PATCH] adds dynamic audit integration test Kubernetes-commit: d995047366153d86f0061b829ee4e7657f17996b --- pkg/server/options/audit.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/server/options/audit.go b/pkg/server/options/audit.go index 402a703ac..98b3fc615 100644 --- a/pkg/server/options/audit.go +++ b/pkg/server/options/audit.go @@ -148,9 +148,14 @@ type AuditWebhookOptions struct { GroupVersionString string } +// AuditDynamicOptions control the configuration of dynamic backends for audit events type AuditDynamicOptions struct { // Enabled tells whether the dynamic audit capability is enabled. Enabled bool + + // Configuration for batching backend. This is currently only used as an override + // for integration tests + BatchConfig *pluginbuffered.BatchConfig } func NewAuditOptions() *AuditOptions { @@ -174,7 +179,8 @@ func NewAuditOptions() *AuditOptions { GroupVersionString: "audit.k8s.io/v1", }, DynamicOptions: AuditDynamicOptions{ - Enabled: false, + Enabled: false, + BatchConfig: plugindynamic.NewDefaultWebhookBatchConfig(), }, } } @@ -634,7 +640,7 @@ func (o *AuditDynamicOptions) newBackend( dc := &plugindynamic.Config{ Informer: informer, - BufferedConfig: plugindynamic.NewDefaultWebhookBatchConfig(), + BufferedConfig: o.BatchConfig, EventConfig: plugindynamic.EventConfig{ Sink: eventSink, Source: corev1.EventSource{