@@ -229,6 +229,7 @@ func TestReconcile(t *testing.T) {
229
229
func TestReconcileTLS (t * testing.T ) {
230
230
// The gateway API annoyingly has a number of
231
231
secretName := "name-WE-STICK-A-LONG-UID-HERE"
232
+ ingressName := "name"
232
233
nsName := "ns"
233
234
deleteTime := time .Now ().Add (- 10 * time .Second )
234
235
table := TableTest {{
@@ -240,8 +241,8 @@ func TestReconcileTLS(t *testing.T) {
240
241
gw (defaultListener ),
241
242
},
242
243
WantCreates : []runtime.Object {
243
- httpRoute (t , ing (withBasicSpec , withGatewayAPIClass , withTLS ())),
244
- rp (secret (secretName , nsName )),
244
+ httpRoute (t , ing (withBasicSpec , withGatewayAPIClass , withTLS (), withName ( ingressName ) )),
245
+ rp (ingressName , secret (secretName , nsName )),
245
246
},
246
247
WantUpdates : []clientgotesting.UpdateActionImpl {{
247
248
Object : gw (defaultListener , tlsListener ("example.com" , nsName , secretName )),
@@ -271,8 +272,8 @@ func TestReconcileTLS(t *testing.T) {
271
272
ing (withBasicSpec , withFinalizer , withGatewayAPIClass , withTLS (), makeItReady ),
272
273
secret (secretName , nsName ),
273
274
gw (defaultListener , tlsListener ("example.com" , nsName , secretName )),
274
- httpRoute (t , ing (withBasicSpec , withGatewayAPIClass , withTLS ()), httpRouteReady ),
275
- rp (secret (secretName , nsName )),
275
+ httpRoute (t , ing (withBasicSpec , withGatewayAPIClass , withTLS (), withName ( ingressName ) ), httpRouteReady ),
276
+ rp (ingressName , secret (secretName , nsName )),
276
277
},
277
278
WantUpdates : []clientgotesting.UpdateActionImpl {
278
279
// None
@@ -292,8 +293,8 @@ func TestReconcileTLS(t *testing.T) {
292
293
}),
293
294
secret (secretName , nsName ),
294
295
gw (defaultListener , tlsListener ("secure.example.com" , nsName , secretName )),
295
- httpRoute (t , ing (withBasicSpec , withGatewayAPIClass , withTLS ())),
296
- rp (secret (secretName , nsName )),
296
+ httpRoute (t , ing (withBasicSpec , withGatewayAPIClass , withTLS (), withName ( ingressName ) )),
297
+ rp (ingressName , secret (secretName , nsName )),
297
298
},
298
299
WantUpdates : []clientgotesting.UpdateActionImpl {{
299
300
Object : gw (defaultListener ),
@@ -307,8 +308,8 @@ func TestReconcileTLS(t *testing.T) {
307
308
secret (secretName , nsName ),
308
309
},
309
310
WantCreates : []runtime.Object {
310
- httpRoute (t , ing (withBasicSpec , withGatewayAPIClass , withTLS ())),
311
- rp (secret (secretName , nsName )),
311
+ httpRoute (t , ing (withBasicSpec , withGatewayAPIClass , withTLS (), withName ( ingressName ) )),
312
+ rp (ingressName , secret (secretName , nsName )),
312
313
},
313
314
WantUpdates : []clientgotesting.UpdateActionImpl {
314
315
// None
@@ -2546,6 +2547,12 @@ func withTLS() IngressOption {
2546
2547
}
2547
2548
}
2548
2549
2550
+ func withName (name string ) IngressOption {
2551
+ return func (i * v1alpha1.Ingress ) {
2552
+ i .Name = name
2553
+ }
2554
+ }
2555
+
2549
2556
func secret (name , ns string ) * corev1.Secret {
2550
2557
return & corev1.Secret {
2551
2558
ObjectMeta : metav1.ObjectMeta {
@@ -2560,11 +2567,11 @@ func secret(name, ns string) *corev1.Secret {
2560
2567
}
2561
2568
}
2562
2569
2563
- func rp (to * corev1.Secret ) * gatewayapiv1beta1.ReferenceGrant {
2570
+ func rp (ingressName string , to * corev1.Secret ) * gatewayapiv1beta1.ReferenceGrant {
2564
2571
t := true
2565
2572
return & gatewayapiv1beta1.ReferenceGrant {
2566
2573
ObjectMeta : metav1.ObjectMeta {
2567
- Name : to .Name + "-" + testNamespace ,
2574
+ Name : ingressName + "-" + to .Name + "-" + testNamespace ,
2568
2575
Namespace : to .Namespace ,
2569
2576
OwnerReferences : []metav1.OwnerReference {{
2570
2577
APIVersion : "networking.internal.knative.dev/v1alpha1" ,
0 commit comments