Skip to content
This repository has been archived by the owner on Sep 19, 2018. It is now read-only.

Commit

Permalink
Fix ingresses watch test
Browse files Browse the repository at this point in the history
  • Loading branch information
Foivos Filippopoulos committed Mar 27, 2018
1 parent a65f013 commit 8a90d1f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 8a90d1f

Please sign in to comment.