[client-go #1415] Use transformer from provided store within internal stores in reflector to limit memory usage bursts

Signed-off-by: Valerian Roche <valerian.roche@datadoghq.com>

Kubernetes-commit: 585ed0a5cb378e794e4775bc846d5309ca65f2c6
This commit is contained in:
Valerian Roche
2025-06-26 22:00:41 -04:00
committed by Kubernetes Publisher
parent c2ce9a8b31
commit 71776a84bd
6 changed files with 190 additions and 5 deletions

View File

@@ -18,11 +18,12 @@ package cache
import (
"fmt"
"sync"
"time"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/sets"
utiltrace "k8s.io/utils/trace"
"sync"
"time"
)
// RealFIFO is a Queue in which every notification from the Reflector is passed
@@ -389,6 +390,11 @@ func (f *RealFIFO) Resync() error {
return nil
}
// Transformer implements the TransformingStore interface.
func (f *RealFIFO) Transformer() TransformFunc {
return f.transformer
}
// NewRealFIFO returns a Store which can be used to queue up items to
// process.
func NewRealFIFO(keyFunc KeyFunc, knownObjects KeyListerGetter, transformer TransformFunc) *RealFIFO {