@@ -204,8 +204,13 @@ func TestEqualityVirtualHosts(t *testing.T) {
204
204
func TestEquals (t * testing.T ) {
205
205
ingress := newGenericIngress ("foo.app.com" , "foo.cluster.com" )
206
206
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 )
209
214
210
215
vmatch , cmatch := c .equals (c2 )
211
216
if vmatch != true {
@@ -221,8 +226,13 @@ func TestNotEquals(t *testing.T) {
221
226
ingress2 := newGenericIngress ("foo.app.com" , "bar.cluster.com" )
222
227
ingress3 := newGenericIngress ("foo.baz.com" , "bar.cluster.com" )
223
228
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 )
226
236
227
237
vmatch , cmatch := c .equals (c2 )
228
238
if vmatch == true {
@@ -237,8 +247,13 @@ func TestNotEquals(t *testing.T) {
237
247
func TestPartialEquals (t * testing.T ) {
238
248
ingress := newGenericIngress ("foo.app.com" , "bar.cluster.com" )
239
249
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 )
242
257
243
258
vmatch , cmatch := c2 .equals (c )
244
259
if vmatch != true {
@@ -252,7 +267,12 @@ func TestPartialEquals(t *testing.T) {
252
267
253
268
func TestGeneratesForSingleIngress (t * testing.T ) {
254
269
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 )
256
276
257
277
if len (c .VirtualHosts ) != 1 {
258
278
t .Error ("expected 1 virtual host" )
@@ -288,7 +308,12 @@ func TestGeneratesForSingleIngress(t *testing.T) {
288
308
func TestGeneratesForMultipleIngressSharingSpecHost (t * testing.T ) {
289
309
fooIngress := newGenericIngress ("app.com" , "foo.com" )
290
310
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 )
292
317
293
318
if len (c .VirtualHosts ) != 1 {
294
319
t .Error ("expected 1 virtual host" )
@@ -343,7 +368,12 @@ func TestFilterNonMatchingIngresses(t *testing.T) {
343
368
344
369
func TestIngressWithIP (t * testing.T ) {
345
370
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 )
347
377
if c .Clusters [0 ].Hosts [0 ].Host != "127.0.0.1" {
348
378
t .Errorf ("expected cluster host to be IP address, was %s" , c .Clusters [0 ].Hosts [0 ].Host )
349
379
}
0 commit comments