Merge pull request #69902 from pbarker/audit-int

integration test for dynamic audit
This commit is contained in:
Kubernetes Prow Robot
2019-01-17 17:11:28 -08:00
committed by GitHub
13 changed files with 674 additions and 107 deletions

View File

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