From 8a90d1f74085e89c7f27d3e7244e265fdf2683ac Mon Sep 17 00:00:00 2001 From: Foivos Filippopoulos Date: Tue, 27 Mar 2018 10:54:15 +0100 Subject: [PATCH] Fix ingresses watch test --- ingress_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ingress_test.go b/ingress_test.go index 4077421..f274db6 100644 --- a/ingress_test.go +++ b/ingress_test.go @@ -11,6 +11,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/kubernetes/fake" + testcore "k8s.io/client-go/testing" ) var ( @@ -218,8 +219,9 @@ type testIngressEvent struct { func newTestIngressWatcherClient(initial ...v1beta1.Ingress) (*fake.Clientset, *watch.FakeWatcher) { client := fake.NewSimpleClientset(&v1beta1.IngressList{Items: initial}) - watcher, _ := client.Extensions().Ingresses(v1.NamespaceDefault).Watch(v1.ListOptions{}) - return client, watcher.(*watch.FakeWatcher) + watcher := watch.NewFake() + client.PrependWatchReactor("ingresses", testcore.DefaultWatchReactor(watcher, nil)) + return client, watcher } func waitForTrue(test func() bool, timeout time.Duration) error {