Replace deprecated NewDeltaFIFO with NewDeltaFIFOWithOptions

Kubernetes-commit: 8dc45c8e0ecdefa37df8c118f38fa0767c5c52b0
This commit is contained in:
Wang Yiping
2021-03-18 08:30:29 +08:00
committed by Kubernetes Publisher
parent af56ae8bf9
commit aa707b1f81
2 changed files with 51 additions and 48 deletions

View File

@@ -44,7 +44,10 @@ func Example() {
// This will hold incoming changes. Note how we pass downstream in as a
// KeyLister, that way resync operations will result in the correct set
// of update/delete deltas.
fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, downstream)
fifo := NewDeltaFIFOWithOptions(DeltaFIFOOptions{
KeyFunction: MetaNamespaceKeyFunc,
KnownObjects: downstream,
})
// Let's do threadsafe output to get predictable test results.
deletionCounter := make(chan string, 1000)