@@ -204,8 +204,13 @@ func TestEqualityVirtualHosts(t *testing.T) {
204204func TestEquals (t * testing.T ) {
205205 ingress := newGenericIngress ("foo.app.com" , "foo.cluster.com" )
206206 ingress2 := newGenericIngress ("bar.app.com" , "foo.bar.com" )
207- c := translateIngresses ([]* k8s.Ingress {ingress , ingress2 }, false , []* v1.Secret {})
208- c2 := translateIngresses ([]* k8s.Ingress {ingress , ingress2 }, false , []* v1.Secret {})
207+ timeouts := DefaultTimeouts {
208+ Cluster : 30 * time .Second ,
209+ Route : 15 * time .Second ,
210+ PerTry : 5 * time .Second ,
211+ }
212+ c := translateIngresses ([]* k8s.Ingress {ingress , ingress2 }, false , []* v1.Secret {}, timeouts )
213+ c2 := translateIngresses ([]* k8s.Ingress {ingress , ingress2 }, false , []* v1.Secret {}, timeouts )
209214
210215 vmatch , cmatch := c .equals (c2 )
211216 if vmatch != true {
@@ -221,8 +226,13 @@ func TestNotEquals(t *testing.T) {
221226 ingress2 := newGenericIngress ("foo.app.com" , "bar.cluster.com" )
222227 ingress3 := newGenericIngress ("foo.baz.com" , "bar.cluster.com" )
223228 ingress4 := newGenericIngress ("foo.howdy.com" , "bar.cluster.com" )
224- c := translateIngresses ([]* k8s.Ingress {ingress , ingress3 , ingress2 }, false , []* v1.Secret {})
225- c2 := translateIngresses ([]* k8s.Ingress {ingress , ingress2 , ingress4 }, false , []* v1.Secret {})
229+ timeouts := DefaultTimeouts {
230+ Cluster : 30 * time .Second ,
231+ Route : 15 * time .Second ,
232+ PerTry : 5 * time .Second ,
233+ }
234+ c := translateIngresses ([]* k8s.Ingress {ingress , ingress3 , ingress2 }, false , []* v1.Secret {}, timeouts )
235+ c2 := translateIngresses ([]* k8s.Ingress {ingress , ingress2 , ingress4 }, false , []* v1.Secret {}, timeouts )
226236
227237 vmatch , cmatch := c .equals (c2 )
228238 if vmatch == true {
@@ -237,8 +247,13 @@ func TestNotEquals(t *testing.T) {
237247func TestPartialEquals (t * testing.T ) {
238248 ingress := newGenericIngress ("foo.app.com" , "bar.cluster.com" )
239249 ingress2 := newGenericIngress ("foo.app.com" , "foo.cluster.com" )
240- c := translateIngresses ([]* k8s.Ingress {ingress2 }, false , []* v1.Secret {})
241- c2 := translateIngresses ([]* k8s.Ingress {ingress }, false , []* v1.Secret {})
250+ timeouts := DefaultTimeouts {
251+ Cluster : 30 * time .Second ,
252+ Route : 15 * time .Second ,
253+ PerTry : 5 * time .Second ,
254+ }
255+ c := translateIngresses ([]* k8s.Ingress {ingress2 }, false , []* v1.Secret {}, timeouts )
256+ c2 := translateIngresses ([]* k8s.Ingress {ingress }, false , []* v1.Secret {}, timeouts )
242257
243258 vmatch , cmatch := c2 .equals (c )
244259 if vmatch != true {
@@ -252,7 +267,12 @@ func TestPartialEquals(t *testing.T) {
252267
253268func TestGeneratesForSingleIngress (t * testing.T ) {
254269 ingress := newGenericIngress ("foo.app.com" , "foo.cluster.com" )
255- c := translateIngresses ([]* k8s.Ingress {ingress }, false , []* v1.Secret {})
270+ timeouts := DefaultTimeouts {
271+ Cluster : 30 * time .Second ,
272+ Route : 15 * time .Second ,
273+ PerTry : 5 * time .Second ,
274+ }
275+ c := translateIngresses ([]* k8s.Ingress {ingress }, false , []* v1.Secret {}, timeouts )
256276
257277 if len (c .VirtualHosts ) != 1 {
258278 t .Error ("expected 1 virtual host" )
@@ -288,7 +308,12 @@ func TestGeneratesForSingleIngress(t *testing.T) {
288308func TestGeneratesForMultipleIngressSharingSpecHost (t * testing.T ) {
289309 fooIngress := newGenericIngress ("app.com" , "foo.com" )
290310 barIngress := newGenericIngress ("app.com" , "bar.com" )
291- c := translateIngresses ([]* k8s.Ingress {fooIngress , barIngress }, false , []* v1.Secret {})
311+ timeouts := DefaultTimeouts {
312+ Cluster : 30 * time .Second ,
313+ Route : 15 * time .Second ,
314+ PerTry : 5 * time .Second ,
315+ }
316+ c := translateIngresses ([]* k8s.Ingress {fooIngress , barIngress }, false , []* v1.Secret {}, timeouts )
292317
293318 if len (c .VirtualHosts ) != 1 {
294319 t .Error ("expected 1 virtual host" )
@@ -343,7 +368,12 @@ func TestFilterNonMatchingIngresses(t *testing.T) {
343368
344369func TestIngressWithIP (t * testing.T ) {
345370 ingress := newIngressIP ("app.com" , "127.0.0.1" )
346- c := translateIngresses ([]* k8s.Ingress {ingress }, false , []* v1.Secret {})
371+ timeouts := DefaultTimeouts {
372+ Cluster : 30 * time .Second ,
373+ Route : 15 * time .Second ,
374+ PerTry : 5 * time .Second ,
375+ }
376+ c := translateIngresses ([]* k8s.Ingress {ingress }, false , []* v1.Secret {}, timeouts )
347377 if c .Clusters [0 ].Hosts [0 ].Host != "127.0.0.1" {
348378 t .Errorf ("expected cluster host to be IP address, was %s" , c .Clusters [0 ].Hosts [0 ].Host )
349379 }
0 commit comments