Unverified Commit 0016ac3a authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #65970 from loburm/automated-cherry-pick-of-#65823-upstream-release-1.10

Automatic merge from submit-queue. Automated cherry pick of #65823: Fix truncating and buffering backends integration. Cherry pick of #65823 on release-1.10. #65823: Fix truncating and buffering backends integration.
parents 986ed675 d5f543eb
......@@ -102,6 +102,7 @@ type bufferedBackend struct {
var _ audit.Backend = &bufferedBackend{}
// NewBackend returns a buffered audit backend that wraps delegate backend.
// Buffered backend automatically runs and shuts down the delegate backend.
func NewBackend(delegate audit.Backend, config BatchConfig) audit.Backend {
var throttle flowcontrol.RateLimiter
if config.ThrottleEnable {
......
......@@ -62,6 +62,7 @@ type backend struct {
var _ audit.Backend = &backend{}
// NewBackend returns a new truncating backend, using configuration passed in the parameters.
// Truncate backend automatically runs and shut downs the delegate backend.
func NewBackend(delegateBackend audit.Backend, config Config, groupVersion schema.GroupVersion) audit.Backend {
return &backend{
delegateBackend: delegateBackend,
......@@ -128,12 +129,11 @@ func truncate(e *auditinternal.Event) *auditinternal.Event {
}
func (b *backend) Run(stopCh <-chan struct{}) error {
// Nothing to do here
return nil
return b.delegateBackend.Run(stopCh)
}
func (b *backend) Shutdown() {
// Nothing to do here
b.delegateBackend.Shutdown()
}
func (b *backend) calcSize(e *auditinternal.Event) (int64, error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment