@@ -422,21 +422,21 @@ var _ = Describe("ChangeProcessor", func() {
422
422
423
423
Describe ("Process gateway resources" , Ordered , func () {
424
424
var (
425
- gcUpdated * v1.GatewayClass
426
- diffNsTLSSecret , sameNsTLSSecret * apiv1.Secret
427
- hr1 , hr1Updated , hr2 * v1.HTTPRoute
428
- gr1 , gr1Updated , gr2 * v1.GRPCRoute
429
- tr1 , tr1Updated , tr2 * v1alpha2.TLSRoute
430
- gw1 , gw1Updated , gw2 * v1.Gateway
431
- secretRefGrant , hrServiceRefGrant * v1beta1.ReferenceGrant
432
- grServiceRefGrant , trServiceRefGrant * v1beta1.ReferenceGrant
433
- expGraph * graph.Graph
434
- expRouteHR1 , expRouteHR2 * graph.L7Route
435
- expRouteGR1 , expRouteGR2 * graph.L7Route
436
- expRouteTR1 , expRouteTR2 * graph.L4Route
437
- gatewayAPICRD , gatewayAPICRDUpdated * metav1.PartialObjectMetadata
438
- routeKey1 , routeKey2 , grpcRouteKey1 , grpcRouteKey2 graph.RouteKey
439
- trKey1 , trKey2 graph.L4RouteKey
425
+ gcUpdated * v1.GatewayClass
426
+ diffNsTLSSecret , sameNsTLSSecret * apiv1.Secret
427
+ hr1 , hr1Updated , hr2 * v1.HTTPRoute
428
+ gr1 , gr1Updated , gr2 * v1.GRPCRoute
429
+ tr1 , tr1Updated , tr2 * v1alpha2.TLSRoute
430
+ gw1 , gw1Updated , gw2 * v1.Gateway
431
+ secretRefGrant , hrServiceRefGrant * v1beta1.ReferenceGrant
432
+ grServiceRefGrant , trServiceRefGrant * v1beta1.ReferenceGrant
433
+ expGraph * graph.Graph
434
+ expRouteHR1 , expRouteHR2 * graph.L7Route
435
+ expRouteGR1 , expRouteGR2 * graph.L7Route
436
+ expRouteTR1 , expRouteTR2 * graph.L4Route
437
+ gatewayAPICRD , gatewayAPICRDUpdated * metav1.PartialObjectMetadata
438
+ httpRouteKey1 , httpRouteKey2 , grpcRouteKey1 , grpcRouteKey2 graph.RouteKey
439
+ trKey1 , trKey2 graph.L4RouteKey
440
440
)
441
441
442
442
processAndValidateGraph := func (expGraph * graph.Graph ) {
@@ -473,11 +473,11 @@ var _ = Describe("ChangeProcessor", func() {
473
473
}
474
474
475
475
hr1 = createHTTPRoute ("hr-1" , "gateway-1" , "foo.example.com" , crossNsHTTPBackendRef )
476
- routeKey1 = graph .CreateRouteKey (hr1 )
476
+ httpRouteKey1 = graph .CreateRouteKey (hr1 )
477
477
hr1Updated = hr1 .DeepCopy ()
478
478
hr1Updated .Generation ++
479
479
hr2 = createHTTPRoute ("hr-2" , "gateway-2" , "bar.example.com" )
480
- routeKey2 = graph .CreateRouteKey (hr2 )
480
+ httpRouteKey2 = graph .CreateRouteKey (hr2 )
481
481
482
482
gr1 = createGRPCRoute ("gr-1" , "gateway-1" , "foo.example.com" , grpcBackendRef )
483
483
grpcRouteKey1 = graph .CreateRouteKey (gr1 )
@@ -897,7 +897,7 @@ var _ = Describe("ChangeProcessor", func() {
897
897
Source : gw1 .Spec .Listeners [0 ],
898
898
Valid : true ,
899
899
Attachable : true ,
900
- Routes : map [graph.RouteKey ]* graph.L7Route {routeKey1 : expRouteHR1 , grpcRouteKey1 : expRouteGR1 },
900
+ Routes : map [graph.RouteKey ]* graph.L7Route {httpRouteKey1 : expRouteHR1 , grpcRouteKey1 : expRouteGR1 },
901
901
L4Routes : map [graph.L4RouteKey ]* graph.L4Route {},
902
902
SupportedKinds : []v1.RouteGroupKind {
903
903
{Kind : v1 .Kind (kinds .HTTPRoute ), Group : helpers.GetPointer [v1.Group ](v1 .GroupName )},
@@ -909,7 +909,7 @@ var _ = Describe("ChangeProcessor", func() {
909
909
Source : gw1 .Spec .Listeners [1 ],
910
910
Valid : true ,
911
911
Attachable : true ,
912
- Routes : map [graph.RouteKey ]* graph.L7Route {routeKey1 : expRouteHR1 , grpcRouteKey1 : expRouteGR1 },
912
+ Routes : map [graph.RouteKey ]* graph.L7Route {httpRouteKey1 : expRouteHR1 , grpcRouteKey1 : expRouteGR1 },
913
913
L4Routes : map [graph.L4RouteKey ]* graph.L4Route {},
914
914
ResolvedSecret : helpers .GetPointer (client .ObjectKeyFromObject (diffNsTLSSecret )),
915
915
SupportedKinds : []v1.RouteGroupKind {
@@ -933,7 +933,7 @@ var _ = Describe("ChangeProcessor", func() {
933
933
},
934
934
IgnoredGateways : map [types.NamespacedName ]* v1.Gateway {},
935
935
L4Routes : map [graph.L4RouteKey ]* graph.L4Route {trKey1 : expRouteTR1 },
936
- Routes : map [graph.RouteKey ]* graph.L7Route {routeKey1 : expRouteHR1 , grpcRouteKey1 : expRouteGR1 },
936
+ Routes : map [graph.RouteKey ]* graph.L7Route {httpRouteKey1 : expRouteHR1 , grpcRouteKey1 : expRouteGR1 },
937
937
ReferencedSecrets : map [types.NamespacedName ]* graph.Secret {},
938
938
ReferencedServices : map [types.NamespacedName ]struct {}{
939
939
{
@@ -1010,7 +1010,7 @@ var _ = Describe("ChangeProcessor", func() {
1010
1010
expGraph .Gateway .Listeners = nil
1011
1011
1012
1012
// no ref grant exists yet for the routes
1013
- expGraph .Routes [routeKey1 ].Conditions = []conditions.Condition {
1013
+ expGraph .Routes [httpRouteKey1 ].Conditions = []conditions.Condition {
1014
1014
staticConds .NewRouteBackendRefRefNotPermitted (
1015
1015
"Backend ref to Service service-ns/service not permitted by any ReferenceGrant" ,
1016
1016
),
@@ -1029,11 +1029,11 @@ var _ = Describe("ChangeProcessor", func() {
1029
1029
}
1030
1030
1031
1031
// gateway class does not exist so routes cannot attach
1032
- expGraph .Routes [routeKey1 ].ParentRefs [0 ].Attachment = & graph.ParentRefAttachmentStatus {
1032
+ expGraph .Routes [httpRouteKey1 ].ParentRefs [0 ].Attachment = & graph.ParentRefAttachmentStatus {
1033
1033
AcceptedHostnames : map [string ][]string {},
1034
1034
FailedCondition : staticConds .NewRouteNoMatchingParent (),
1035
1035
}
1036
- expGraph .Routes [routeKey1 ].ParentRefs [1 ].Attachment = & graph.ParentRefAttachmentStatus {
1036
+ expGraph .Routes [httpRouteKey1 ].ParentRefs [1 ].Attachment = & graph.ParentRefAttachmentStatus {
1037
1037
AcceptedHostnames : map [string ][]string {},
1038
1038
FailedCondition : staticConds .NewRouteNoMatchingParent (),
1039
1039
}
@@ -1092,20 +1092,20 @@ var _ = Describe("ChangeProcessor", func() {
1092
1092
}
1093
1093
1094
1094
listener80 := getListenerByName (expGraph .Gateway , httpListenerName )
1095
- listener80 .Routes [routeKey1 ].ParentRefs [0 ].Attachment = expAttachment80
1096
- listener443 .Routes [routeKey1 ].ParentRefs [1 ].Attachment = expAttachment443
1095
+ listener80 .Routes [httpRouteKey1 ].ParentRefs [0 ].Attachment = expAttachment80
1096
+ listener443 .Routes [httpRouteKey1 ].ParentRefs [1 ].Attachment = expAttachment443
1097
1097
listener80 .Routes [grpcRouteKey1 ].ParentRefs [0 ].Attachment = expAttachment80
1098
1098
listener443 .Routes [grpcRouteKey1 ].ParentRefs [1 ].Attachment = expAttachment443
1099
1099
1100
1100
// no ref grant exists yet for hr1
1101
- expGraph .Routes [routeKey1 ].Conditions = []conditions.Condition {
1101
+ expGraph .Routes [httpRouteKey1 ].Conditions = []conditions.Condition {
1102
1102
staticConds .NewRouteInvalidListener (),
1103
1103
staticConds .NewRouteBackendRefRefNotPermitted (
1104
1104
"Backend ref to Service service-ns/service not permitted by any ReferenceGrant" ,
1105
1105
),
1106
1106
}
1107
- expGraph .Routes [routeKey1 ].ParentRefs [0 ].Attachment = expAttachment80
1108
- expGraph .Routes [routeKey1 ].ParentRefs [1 ].Attachment = expAttachment443
1107
+ expGraph .Routes [httpRouteKey1 ].ParentRefs [0 ].Attachment = expAttachment80
1108
+ expGraph .Routes [httpRouteKey1 ].ParentRefs [1 ].Attachment = expAttachment443
1109
1109
1110
1110
// no ref grant exists yet for gr1
1111
1111
expGraph .Routes [grpcRouteKey1 ].Conditions = []conditions.Condition {
@@ -1139,7 +1139,7 @@ var _ = Describe("ChangeProcessor", func() {
1139
1139
processor .CaptureUpsertChange (secretRefGrant )
1140
1140
1141
1141
// no ref grant exists yet for hr1
1142
- expGraph .Routes [routeKey1 ].Conditions = []conditions.Condition {
1142
+ expGraph .Routes [httpRouteKey1 ].Conditions = []conditions.Condition {
1143
1143
staticConds .NewRouteBackendRefRefNotPermitted (
1144
1144
"Backend ref to Service service-ns/service not permitted by any ReferenceGrant" ,
1145
1145
),
@@ -1283,10 +1283,10 @@ var _ = Describe("ChangeProcessor", func() {
1283
1283
processor .CaptureUpsertChange (hr1Updated )
1284
1284
1285
1285
listener443 := getListenerByName (expGraph .Gateway , httpsListenerName )
1286
- listener443 .Routes [routeKey1 ].Source .SetGeneration (hr1Updated .Generation )
1286
+ listener443 .Routes [httpRouteKey1 ].Source .SetGeneration (hr1Updated .Generation )
1287
1287
1288
1288
listener80 := getListenerByName (expGraph .Gateway , httpListenerName )
1289
- listener80 .Routes [routeKey1 ].Source .SetGeneration (hr1Updated .Generation )
1289
+ listener80 .Routes [httpRouteKey1 ].Source .SetGeneration (hr1Updated .Generation )
1290
1290
expGraph .ReferencedSecrets [client .ObjectKeyFromObject (diffNsTLSSecret )] = & graph.Secret {
1291
1291
Source : diffNsTLSSecret ,
1292
1292
}
@@ -1407,12 +1407,12 @@ var _ = Describe("ChangeProcessor", func() {
1407
1407
expGraph .IgnoredGateways = map [types.NamespacedName ]* v1.Gateway {
1408
1408
{Namespace : "test" , Name : "gateway-2" }: gw2 ,
1409
1409
}
1410
- expGraph .Routes [routeKey2 ] = expRouteHR2
1411
- expGraph .Routes [routeKey2 ].ParentRefs [0 ].Attachment = & graph.ParentRefAttachmentStatus {
1410
+ expGraph .Routes [httpRouteKey2 ] = expRouteHR2
1411
+ expGraph .Routes [httpRouteKey2 ].ParentRefs [0 ].Attachment = & graph.ParentRefAttachmentStatus {
1412
1412
AcceptedHostnames : map [string ][]string {},
1413
1413
FailedCondition : staticConds .NewRouteNotAcceptedGatewayIgnored (),
1414
1414
}
1415
- expGraph .Routes [routeKey2 ].ParentRefs [1 ].Attachment = & graph.ParentRefAttachmentStatus {
1415
+ expGraph .Routes [httpRouteKey2 ].ParentRefs [1 ].Attachment = & graph.ParentRefAttachmentStatus {
1416
1416
AcceptedHostnames : map [string ][]string {},
1417
1417
FailedCondition : staticConds .NewRouteNotAcceptedGatewayIgnored (),
1418
1418
}
@@ -1430,12 +1430,12 @@ var _ = Describe("ChangeProcessor", func() {
1430
1430
expGraph .IgnoredGateways = map [types.NamespacedName ]* v1.Gateway {
1431
1431
{Namespace : "test" , Name : "gateway-2" }: gw2 ,
1432
1432
}
1433
- expGraph .Routes [routeKey2 ] = expRouteHR2
1434
- expGraph .Routes [routeKey2 ].ParentRefs [0 ].Attachment = & graph.ParentRefAttachmentStatus {
1433
+ expGraph .Routes [httpRouteKey2 ] = expRouteHR2
1434
+ expGraph .Routes [httpRouteKey2 ].ParentRefs [0 ].Attachment = & graph.ParentRefAttachmentStatus {
1435
1435
AcceptedHostnames : map [string ][]string {},
1436
1436
FailedCondition : staticConds .NewRouteNotAcceptedGatewayIgnored (),
1437
1437
}
1438
- expGraph .Routes [routeKey2 ].ParentRefs [1 ].Attachment = & graph.ParentRefAttachmentStatus {
1438
+ expGraph .Routes [httpRouteKey2 ].ParentRefs [1 ].Attachment = & graph.ParentRefAttachmentStatus {
1439
1439
AcceptedHostnames : map [string ][]string {},
1440
1440
FailedCondition : staticConds .NewRouteNotAcceptedGatewayIgnored (),
1441
1441
}
@@ -1464,12 +1464,12 @@ var _ = Describe("ChangeProcessor", func() {
1464
1464
expGraph .IgnoredGateways = map [types.NamespacedName ]* v1.Gateway {
1465
1465
{Namespace : "test" , Name : "gateway-2" }: gw2 ,
1466
1466
}
1467
- expGraph .Routes [routeKey2 ] = expRouteHR2
1468
- expGraph .Routes [routeKey2 ].ParentRefs [0 ].Attachment = & graph.ParentRefAttachmentStatus {
1467
+ expGraph .Routes [httpRouteKey2 ] = expRouteHR2
1468
+ expGraph .Routes [httpRouteKey2 ].ParentRefs [0 ].Attachment = & graph.ParentRefAttachmentStatus {
1469
1469
AcceptedHostnames : map [string ][]string {},
1470
1470
FailedCondition : staticConds .NewRouteNotAcceptedGatewayIgnored (),
1471
1471
}
1472
- expGraph .Routes [routeKey2 ].ParentRefs [1 ].Attachment = & graph.ParentRefAttachmentStatus {
1472
+ expGraph .Routes [httpRouteKey2 ].ParentRefs [1 ].Attachment = & graph.ParentRefAttachmentStatus {
1473
1473
AcceptedHostnames : map [string ][]string {},
1474
1474
FailedCondition : staticConds .NewRouteNotAcceptedGatewayIgnored (),
1475
1475
}
@@ -1515,23 +1515,23 @@ var _ = Describe("ChangeProcessor", func() {
1515
1515
listener443 .Source = gw2 .Spec .Listeners [1 ]
1516
1516
tlsListener .Source = gw2 .Spec .Listeners [2 ]
1517
1517
1518
- delete (listener80 .Routes , routeKey1 )
1519
- delete (listener443 .Routes , routeKey1 )
1518
+ delete (listener80 .Routes , httpRouteKey1 )
1519
+ delete (listener443 .Routes , httpRouteKey1 )
1520
1520
delete (listener80 .Routes , grpcRouteKey1 )
1521
1521
delete (listener443 .Routes , grpcRouteKey1 )
1522
1522
delete (tlsListener .L4Routes , trKey1 )
1523
1523
1524
- listener80 .Routes [routeKey2 ] = expRouteHR2
1525
- listener443 .Routes [routeKey2 ] = expRouteHR2
1524
+ listener80 .Routes [httpRouteKey2 ] = expRouteHR2
1525
+ listener443 .Routes [httpRouteKey2 ] = expRouteHR2
1526
1526
listener80 .Routes [grpcRouteKey2 ] = expRouteGR2
1527
1527
listener443 .Routes [grpcRouteKey2 ] = expRouteGR2
1528
1528
tlsListener .L4Routes [trKey2 ] = expRouteTR2
1529
1529
1530
- delete (expGraph .Routes , routeKey1 )
1530
+ delete (expGraph .Routes , httpRouteKey1 )
1531
1531
delete (expGraph .Routes , grpcRouteKey1 )
1532
1532
delete (expGraph .L4Routes , trKey1 )
1533
1533
1534
- expGraph .Routes [routeKey2 ] = expRouteHR2
1534
+ expGraph .Routes [httpRouteKey2 ] = expRouteHR2
1535
1535
expGraph .Routes [grpcRouteKey2 ] = expRouteGR2
1536
1536
expGraph .L4Routes [trKey2 ] = expRouteTR2
1537
1537
@@ -1569,8 +1569,8 @@ var _ = Describe("ChangeProcessor", func() {
1569
1569
listener443 .Source = gw2 .Spec .Listeners [1 ]
1570
1570
tlsListener .Source = gw2 .Spec .Listeners [2 ]
1571
1571
1572
- delete (listener80 .Routes , routeKey1 )
1573
- delete (listener443 .Routes , routeKey1 )
1572
+ delete (listener80 .Routes , httpRouteKey1 )
1573
+ delete (listener443 .Routes , httpRouteKey1 )
1574
1574
delete (listener80 .Routes , grpcRouteKey1 )
1575
1575
delete (listener443 .Routes , grpcRouteKey1 )
1576
1576
delete (tlsListener .L4Routes , trKey1 )
@@ -1579,7 +1579,7 @@ var _ = Describe("ChangeProcessor", func() {
1579
1579
listener443 .Routes [grpcRouteKey2 ] = expRouteGR2
1580
1580
tlsListener .L4Routes [trKey2 ] = expRouteTR2
1581
1581
1582
- delete (expGraph .Routes , routeKey1 )
1582
+ delete (expGraph .Routes , httpRouteKey1 )
1583
1583
delete (expGraph .Routes , grpcRouteKey1 )
1584
1584
expGraph .Routes [grpcRouteKey2 ] = expRouteGR2
1585
1585
@@ -1618,8 +1618,8 @@ var _ = Describe("ChangeProcessor", func() {
1618
1618
listener443 .Source = gw2 .Spec .Listeners [1 ]
1619
1619
tlsListener .Source = gw2 .Spec .Listeners [2 ]
1620
1620
1621
- delete (listener80 .Routes , routeKey1 )
1622
- delete (listener443 .Routes , routeKey1 )
1621
+ delete (listener80 .Routes , httpRouteKey1 )
1622
+ delete (listener443 .Routes , httpRouteKey1 )
1623
1623
delete (listener80 .Routes , grpcRouteKey1 )
1624
1624
delete (listener443 .Routes , grpcRouteKey1 )
1625
1625
delete (tlsListener .L4Routes , trKey1 )
@@ -1662,8 +1662,8 @@ var _ = Describe("ChangeProcessor", func() {
1662
1662
listener443 .Source = gw2 .Spec .Listeners [1 ]
1663
1663
tlsListener .Source = gw2 .Spec .Listeners [2 ]
1664
1664
1665
- delete (listener80 .Routes , routeKey1 )
1666
- delete (listener443 .Routes , routeKey1 )
1665
+ delete (listener80 .Routes , httpRouteKey1 )
1666
+ delete (listener443 .Routes , httpRouteKey1 )
1667
1667
delete (listener80 .Routes , grpcRouteKey1 )
1668
1668
delete (listener443 .Routes , grpcRouteKey1 )
1669
1669
delete (tlsListener .L4Routes , trKey1 )
0 commit comments