mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-07 18:11:31 +00:00
Enable propagration of HasSynced
* Add tracker types and tests * Modify ResourceEventHandler interface's OnAdd member * Add additional ResourceEventHandlerDetailedFuncs struct * Fix SharedInformer to let users track HasSynced for their handlers * Fix in-tree controllers which weren't computing HasSynced correctly * Deprecate the cache.Pop function Kubernetes-commit: 8100efc7b3122ad119ee8fa4bbbedef3b90f2e0d
This commit is contained in:
committed by
Kubernetes Publisher
parent
e7e7d01afd
commit
5d70a118df
8
tools/cache/fifo_test.go
vendored
8
tools/cache/fifo_test.go
vendored
@@ -76,7 +76,7 @@ func TestFIFO_requeueOnPop(t *testing.T) {
|
||||
f := NewFIFO(testFifoObjectKeyFunc)
|
||||
|
||||
f.Add(mkFifoObj("foo", 10))
|
||||
_, err := f.Pop(func(obj interface{}) error {
|
||||
_, err := f.Pop(func(obj interface{}, isInInitialList bool) error {
|
||||
if obj.(testFifoObject).name != "foo" {
|
||||
t.Fatalf("unexpected object: %#v", obj)
|
||||
}
|
||||
@@ -89,7 +89,7 @@ func TestFIFO_requeueOnPop(t *testing.T) {
|
||||
t.Fatalf("object should have been requeued: %t %v", ok, err)
|
||||
}
|
||||
|
||||
_, err = f.Pop(func(obj interface{}) error {
|
||||
_, err = f.Pop(func(obj interface{}, isInInitialList bool) error {
|
||||
if obj.(testFifoObject).name != "foo" {
|
||||
t.Fatalf("unexpected object: %#v", obj)
|
||||
}
|
||||
@@ -102,7 +102,7 @@ func TestFIFO_requeueOnPop(t *testing.T) {
|
||||
t.Fatalf("object should have been requeued: %t %v", ok, err)
|
||||
}
|
||||
|
||||
_, err = f.Pop(func(obj interface{}) error {
|
||||
_, err = f.Pop(func(obj interface{}, isInInitialList bool) error {
|
||||
if obj.(testFifoObject).name != "foo" {
|
||||
t.Fatalf("unexpected object: %#v", obj)
|
||||
}
|
||||
@@ -289,7 +289,7 @@ func TestFIFO_PopShouldUnblockWhenClosed(t *testing.T) {
|
||||
const jobs = 10
|
||||
for i := 0; i < jobs; i++ {
|
||||
go func() {
|
||||
f.Pop(func(obj interface{}) error {
|
||||
f.Pop(func(obj interface{}, isInInitialList bool) error {
|
||||
return nil
|
||||
})
|
||||
c <- struct{}{}
|
||||
|
Reference in New Issue
Block a user