Skip to content

Commit dfbdc73

Browse files
committed
add TLS and UDP listener tests. Fix bugs that were found from the tests
1 parent 8c660cd commit dfbdc73

23 files changed

+590
-305
lines changed

pkg/gateway/model/model_build_target_group.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ func (t *targetGroupBuilderImpl) buildTargetGroup(stack core.Stack,
100100
gw *gwv1.Gateway, lbConfig elbv2gw.LoadBalancerConfiguration, lbIPType elbv2model.IPAddressType, routeDescriptor routeutils.RouteDescriptor, backend routeutils.Backend, backendSGIDToken core.StringToken) (*elbv2model.TargetGroup, error) {
101101

102102
targetGroupProps := backend.ELBV2TargetGroupProps
103-
tgResID := t.buildTargetGroupResourceID(k8s.NamespacedName(gw), k8s.NamespacedName(backend.Service), routeDescriptor.GetRouteNamespacedName(), backend.ServicePort.TargetPort)
103+
tgResID := t.buildTargetGroupResourceID(k8s.NamespacedName(gw), k8s.NamespacedName(backend.Service), routeDescriptor.GetRouteNamespacedName(), routeDescriptor.GetRouteKind(), backend.ServicePort.TargetPort)
104104
if tg, exists := t.tgByResID[tgResID]; exists {
105+
fmt.Println("TG already exists. Returning cached version")
105106
return tg, nil
106107
}
107108

@@ -129,7 +130,7 @@ func (builder *targetGroupBuilderImpl) buildTargetGroupBindingSpec(gw *gwv1.Gate
129130
if targetType == elbv2api.TargetTypeInstance {
130131
targetPort = intstr.FromInt32(backend.ServicePort.NodePort)
131132
}
132-
tgbNetworking := builder.buildTargetGroupBindingNetworking(targetPort, *tgSpec.HealthCheckConfig.Port, *backend.ServicePort, backendSGIDToken)
133+
tgbNetworking := builder.buildTargetGroupBindingNetworking(targetPort, *tgSpec.HealthCheckConfig.Port, tgSpec.Protocol, backendSGIDToken)
133134

134135
multiClusterEnabled := builder.buildTargetGroupBindingMultiClusterFlag(tgProps)
135136

@@ -175,14 +176,14 @@ func (builder *targetGroupBuilderImpl) buildTargetGroupBindingSpec(gw *gwv1.Gate
175176
}
176177
}
177178

178-
func (builder *targetGroupBuilderImpl) buildTargetGroupBindingNetworking(targetPort intstr.IntOrString, healthCheckPort intstr.IntOrString, svcPort corev1.ServicePort, backendSGIDToken core.StringToken) *elbv2model.TargetGroupBindingNetworking {
179+
func (builder *targetGroupBuilderImpl) buildTargetGroupBindingNetworking(targetPort intstr.IntOrString, healthCheckPort intstr.IntOrString, tgProtocol elbv2model.Protocol, backendSGIDToken core.StringToken) *elbv2model.TargetGroupBindingNetworking {
179180
if backendSGIDToken == nil {
180181
return nil
181182
}
182183
protocolTCP := elbv2api.NetworkingProtocolTCP
183184
protocolUDP := elbv2api.NetworkingProtocolUDP
184185

185-
udpSupported := svcPort.Protocol == corev1.ProtocolUDP
186+
udpSupported := tgProtocol == elbv2model.ProtocolUDP || tgProtocol == elbv2model.ProtocolTCP_UDP
186187

187188
if builder.disableRestrictedSGRules {
188189
ports := []elbv2api.NetworkingPort{
@@ -282,7 +283,7 @@ func (builder *targetGroupBuilderImpl) buildTargetGroupSpec(gw *gwv1.Gateway, ro
282283
return elbv2model.TargetGroupSpec{}, err
283284
}
284285
tgPort := builder.buildTargetGroupPort(targetType, *backend.ServicePort)
285-
name := builder.buildTargetGroupName(targetGroupProps, k8s.NamespacedName(gw), route.GetRouteNamespacedName(), k8s.NamespacedName(backend.Service), tgPort, targetType, tgProtocol, tgProtocolVersion)
286+
name := builder.buildTargetGroupName(targetGroupProps, k8s.NamespacedName(gw), route.GetRouteNamespacedName(), route.GetRouteKind(), k8s.NamespacedName(backend.Service), tgPort, targetType, tgProtocol, tgProtocolVersion)
286287
return elbv2model.TargetGroupSpec{
287288
Name: name,
288289
TargetType: targetType,
@@ -300,7 +301,7 @@ var invalidTargetGroupNamePattern = regexp.MustCompile("[[:^alnum:]]")
300301

301302
// buildTargetGroupName will calculate the targetGroup's name.
302303
func (builder *targetGroupBuilderImpl) buildTargetGroupName(targetGroupProps *elbv2gw.TargetGroupProps,
303-
gwKey types.NamespacedName, routeKey types.NamespacedName, svcKey types.NamespacedName, tgPort int32,
304+
gwKey types.NamespacedName, routeKey types.NamespacedName, routeKind routeutils.RouteKind, svcKey types.NamespacedName, tgPort int32,
304305
targetType elbv2model.TargetType, tgProtocol elbv2model.Protocol, tgProtocolVersion *elbv2model.ProtocolVersion) string {
305306

306307
if targetGroupProps != nil && targetGroupProps.TargetGroupName != nil {
@@ -313,6 +314,7 @@ func (builder *targetGroupBuilderImpl) buildTargetGroupName(targetGroupProps *el
313314
_, _ = uuidHash.Write([]byte(gwKey.Name))
314315
_, _ = uuidHash.Write([]byte(routeKey.Namespace))
315316
_, _ = uuidHash.Write([]byte(routeKey.Name))
317+
_, _ = uuidHash.Write([]byte(routeKind))
316318
_, _ = uuidHash.Write([]byte(svcKey.Namespace))
317319
_, _ = uuidHash.Write([]byte(svcKey.Name))
318320
_, _ = uuidHash.Write([]byte(strconv.Itoa(int(tgPort))))
@@ -660,8 +662,8 @@ func (builder *targetGroupBuilderImpl) convertMapToAttributes(attributeMap map[s
660662
return convertedAttributes
661663
}
662664

663-
func (builder *targetGroupBuilderImpl) buildTargetGroupResourceID(gwKey types.NamespacedName, svcKey types.NamespacedName, routeKey types.NamespacedName, port intstr.IntOrString) string {
664-
return fmt.Sprintf("%s/%s:%s-%s:%s-%s:%s", gwKey.Namespace, gwKey.Name, routeKey.Namespace, routeKey.Name, svcKey.Namespace, svcKey.Name, port.String())
665+
func (builder *targetGroupBuilderImpl) buildTargetGroupResourceID(gwKey types.NamespacedName, svcKey types.NamespacedName, routeKey types.NamespacedName, routeKind routeutils.RouteKind, port intstr.IntOrString) string {
666+
return fmt.Sprintf("%s/%s:%s-%s:%s-%s-%s:%s", gwKey.Namespace, gwKey.Name, routeKey.Namespace, routeKey.Name, routeKind, svcKey.Namespace, svcKey.Name, port.String())
665667
}
666668

667669
func (builder *targetGroupBuilderImpl) buildTargetGroupBindingNodeSelector(tgProps *elbv2gw.TargetGroupProps, targetType elbv2model.TargetType) *metav1.LabelSelector {

pkg/gateway/model/model_build_target_group_test.go

Lines changed: 37 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func Test_buildTargetGroupSpec(t *testing.T) {
6868
},
6969
},
7070
expectedTgSpec: elbv2model.TargetGroupSpec{
71-
Name: "k8s-myrouten-myroute-d02da2803b",
71+
Name: "k8s-myrouten-myroute-8d8111f6ac",
7272
TargetType: elbv2model.TargetTypeInstance,
7373
Port: awssdk.Int32(8080),
7474
Protocol: elbv2model.ProtocolTCP,
@@ -123,7 +123,7 @@ func Test_buildTargetGroupSpec(t *testing.T) {
123123
},
124124
},
125125
expectedTgSpec: elbv2model.TargetGroupSpec{
126-
Name: "k8s-myrouten-myroute-d146029dfb",
126+
Name: "k8s-myrouten-myroute-224f4b6ea6",
127127
TargetType: elbv2model.TargetTypeInstance,
128128
Port: awssdk.Int32(8080),
129129
Protocol: elbv2model.ProtocolHTTP,
@@ -183,7 +183,7 @@ func Test_buildTargetGroupSpec(t *testing.T) {
183183
},
184184
},
185185
expectedTgSpec: elbv2model.TargetGroupSpec{
186-
Name: "k8s-myrouten-myroute-d9d6c4e6eb",
186+
Name: "k8s-myrouten-myroute-3bce8b0f70",
187187
TargetType: elbv2model.TargetTypeIP,
188188
Port: awssdk.Int32(80),
189189
Protocol: elbv2model.ProtocolTCP,
@@ -238,7 +238,7 @@ func Test_buildTargetGroupSpec(t *testing.T) {
238238
},
239239
},
240240
expectedTgSpec: elbv2model.TargetGroupSpec{
241-
Name: "k8s-myrouten-myroute-400113e816",
241+
Name: "k8s-myrouten-myroute-a44a20bcbf",
242242
TargetType: elbv2model.TargetTypeIP,
243243
Port: awssdk.Int32(80),
244244
Protocol: elbv2model.ProtocolHTTP,
@@ -413,7 +413,7 @@ func Test_buildTargetGroupBindingSpec(t *testing.T) {
413413
},
414414
},
415415
expectedTgSpec: elbv2model.TargetGroupSpec{
416-
Name: "k8s-myrouten-myroute-d146029dfb",
416+
Name: "k8s-myrouten-myroute-224f4b6ea6",
417417
TargetType: elbv2model.TargetTypeInstance,
418418
Port: awssdk.Int32(8080),
419419
Protocol: elbv2model.ProtocolHTTP,
@@ -441,7 +441,7 @@ func Test_buildTargetGroupBindingSpec(t *testing.T) {
441441
Template: elbv2model.TargetGroupBindingTemplate{
442442
ObjectMeta: metav1.ObjectMeta{
443443
Namespace: "my-svc-ns",
444-
Name: "k8s-myrouten-myroute-d146029dfb",
444+
Name: "k8s-myrouten-myroute-224f4b6ea6",
445445
Annotations: make(map[string]string),
446446
Labels: make(map[string]string),
447447
},
@@ -492,7 +492,7 @@ func Test_buildTargetGroupBindingSpec(t *testing.T) {
492492
},
493493
},
494494
expectedTgSpec: elbv2model.TargetGroupSpec{
495-
Name: "k8s-myrouten-myroute-d9d6c4e6eb",
495+
Name: "k8s-myrouten-myroute-3bce8b0f70",
496496
TargetType: elbv2model.TargetTypeIP,
497497
Port: awssdk.Int32(80),
498498
Protocol: elbv2model.ProtocolTCP,
@@ -515,7 +515,7 @@ func Test_buildTargetGroupBindingSpec(t *testing.T) {
515515
Template: elbv2model.TargetGroupBindingTemplate{
516516
ObjectMeta: metav1.ObjectMeta{
517517
Namespace: "my-svc-ns",
518-
Name: "k8s-myrouten-myroute-d9d6c4e6eb",
518+
Name: "k8s-myrouten-myroute-3bce8b0f70",
519519
Annotations: make(map[string]string),
520520
Labels: make(map[string]string),
521521
},
@@ -566,7 +566,7 @@ func Test_buildTargetGroupBindingSpec(t *testing.T) {
566566
},
567567
},
568568
expectedTgSpec: elbv2model.TargetGroupSpec{
569-
Name: "k8s-myrouten-myroute-400113e816",
569+
Name: "k8s-myrouten-myroute-a44a20bcbf",
570570
TargetType: elbv2model.TargetTypeIP,
571571
Port: awssdk.Int32(80),
572572
Protocol: elbv2model.ProtocolHTTP,
@@ -594,7 +594,7 @@ func Test_buildTargetGroupBindingSpec(t *testing.T) {
594594
Template: elbv2model.TargetGroupBindingTemplate{
595595
ObjectMeta: metav1.ObjectMeta{
596596
Namespace: "my-svc-ns",
597-
Name: "k8s-myrouten-myroute-400113e816",
597+
Name: "k8s-myrouten-myroute-a44a20bcbf",
598598
Annotations: make(map[string]string),
599599
Labels: make(map[string]string),
600600
},
@@ -655,7 +655,7 @@ func Test_buildTargetGroupBindingSpec(t *testing.T) {
655655
},
656656
},
657657
expectedTgSpec: elbv2model.TargetGroupSpec{
658-
Name: "k8s-myrouten-myroute-400113e816",
658+
Name: "k8s-myrouten-myroute-a44a20bcbf",
659659
TargetType: elbv2model.TargetTypeIP,
660660
Port: awssdk.Int32(80),
661661
Protocol: elbv2model.ProtocolHTTP,
@@ -683,7 +683,7 @@ func Test_buildTargetGroupBindingSpec(t *testing.T) {
683683
Template: elbv2model.TargetGroupBindingTemplate{
684684
ObjectMeta: metav1.ObjectMeta{
685685
Namespace: "my-svc-ns",
686-
Name: "k8s-myrouten-myroute-400113e816",
686+
Name: "k8s-myrouten-myroute-a44a20bcbf",
687687
Annotations: map[string]string{
688688
"foo": "bar",
689689
},
@@ -736,7 +736,7 @@ func Test_buildTargetGroupBindingNetworking(t *testing.T) {
736736

737737
targetPort intstr.IntOrString
738738
healthCheckPort intstr.IntOrString
739-
svcPort corev1.ServicePort
739+
tgProtocol elbv2model.Protocol
740740
backendSGIDToken core.StringToken
741741

742742
expected *elbv2model.TargetGroupBindingNetworking
@@ -769,9 +769,7 @@ func Test_buildTargetGroupBindingNetworking(t *testing.T) {
769769
name: "disable restricted sg rules - with udp",
770770
disableRestrictedSGRules: true,
771771
backendSGIDToken: core.LiteralStringToken("foo"),
772-
svcPort: corev1.ServicePort{
773-
Protocol: corev1.ProtocolUDP,
774-
},
772+
tgProtocol: elbv2model.ProtocolUDP,
775773
expected: &elbv2model.TargetGroupBindingNetworking{
776774
Ingress: []elbv2model.NetworkingIngressRule{
777775
{
@@ -799,11 +797,9 @@ func Test_buildTargetGroupBindingNetworking(t *testing.T) {
799797
{
800798
name: "use restricted sg rules - int hc port",
801799
backendSGIDToken: core.LiteralStringToken("foo"),
802-
svcPort: corev1.ServicePort{
803-
Protocol: corev1.ProtocolTCP,
804-
},
805-
targetPort: intstr80,
806-
healthCheckPort: intstr80,
800+
tgProtocol: elbv2model.ProtocolTCP,
801+
targetPort: intstr80,
802+
healthCheckPort: intstr80,
807803
expected: &elbv2model.TargetGroupBindingNetworking{
808804
Ingress: []elbv2model.NetworkingIngressRule{
809805
{
@@ -827,11 +823,9 @@ func Test_buildTargetGroupBindingNetworking(t *testing.T) {
827823
{
828824
name: "use restricted sg rules - int hc port - udp traffic",
829825
backendSGIDToken: core.LiteralStringToken("foo"),
830-
svcPort: corev1.ServicePort{
831-
Protocol: corev1.ProtocolUDP,
832-
},
833-
targetPort: intstr80,
834-
healthCheckPort: intstr80,
826+
tgProtocol: elbv2model.ProtocolUDP,
827+
targetPort: intstr80,
828+
healthCheckPort: intstr80,
835829
expected: &elbv2model.TargetGroupBindingNetworking{
836830
Ingress: []elbv2model.NetworkingIngressRule{
837831
{
@@ -870,11 +864,9 @@ func Test_buildTargetGroupBindingNetworking(t *testing.T) {
870864
{
871865
name: "use restricted sg rules - str hc port",
872866
backendSGIDToken: core.LiteralStringToken("foo"),
873-
svcPort: corev1.ServicePort{
874-
Protocol: corev1.ProtocolTCP,
875-
},
876-
targetPort: intstr80,
877-
healthCheckPort: intstrTrafficPort,
867+
tgProtocol: elbv2model.ProtocolHTTP,
868+
targetPort: intstr80,
869+
healthCheckPort: intstrTrafficPort,
878870
expected: &elbv2model.TargetGroupBindingNetworking{
879871
Ingress: []elbv2model.NetworkingIngressRule{
880872
{
@@ -898,11 +890,9 @@ func Test_buildTargetGroupBindingNetworking(t *testing.T) {
898890
{
899891
name: "use restricted sg rules - str hc port - udp",
900892
backendSGIDToken: core.LiteralStringToken("foo"),
901-
svcPort: corev1.ServicePort{
902-
Protocol: corev1.ProtocolUDP,
903-
},
904-
targetPort: intstr80,
905-
healthCheckPort: intstrTrafficPort,
893+
tgProtocol: elbv2model.ProtocolUDP,
894+
targetPort: intstr80,
895+
healthCheckPort: intstrTrafficPort,
906896
expected: &elbv2model.TargetGroupBindingNetworking{
907897
Ingress: []elbv2model.NetworkingIngressRule{
908898
{
@@ -941,11 +931,9 @@ func Test_buildTargetGroupBindingNetworking(t *testing.T) {
941931
{
942932
name: "use restricted sg rules - diff hc port",
943933
backendSGIDToken: core.LiteralStringToken("foo"),
944-
svcPort: corev1.ServicePort{
945-
Protocol: corev1.ProtocolTCP,
946-
},
947-
targetPort: intstr80,
948-
healthCheckPort: intstr85,
934+
tgProtocol: elbv2model.ProtocolHTTP,
935+
targetPort: intstr80,
936+
healthCheckPort: intstr85,
949937
expected: &elbv2model.TargetGroupBindingNetworking{
950938
Ingress: []elbv2model.NetworkingIngressRule{
951939
{
@@ -984,11 +972,9 @@ func Test_buildTargetGroupBindingNetworking(t *testing.T) {
984972
{
985973
name: "use restricted sg rules - str hc port - udp",
986974
backendSGIDToken: core.LiteralStringToken("foo"),
987-
svcPort: corev1.ServicePort{
988-
Protocol: corev1.ProtocolUDP,
989-
},
990-
targetPort: intstr80,
991-
healthCheckPort: intstr85,
975+
tgProtocol: elbv2model.ProtocolUDP,
976+
targetPort: intstr80,
977+
healthCheckPort: intstr85,
992978
expected: &elbv2model.TargetGroupBindingNetworking{
993979
Ingress: []elbv2model.NetworkingIngressRule{
994980
{
@@ -1031,7 +1017,7 @@ func Test_buildTargetGroupBindingNetworking(t *testing.T) {
10311017
disableRestrictedSGRules: tc.disableRestrictedSGRules,
10321018
}
10331019

1034-
result := builder.buildTargetGroupBindingNetworking(tc.targetPort, tc.healthCheckPort, tc.svcPort, tc.backendSGIDToken)
1020+
result := builder.buildTargetGroupBindingNetworking(tc.targetPort, tc.healthCheckPort, tc.tgProtocol, tc.backendSGIDToken)
10351021
assert.Equal(t, tc.expected, result)
10361022
})
10371023
}
@@ -1066,16 +1052,16 @@ func Test_buildTargetGroupName(t *testing.T) {
10661052
{
10671053
name: "no name in props",
10681054
targetGroupProps: &elbv2gw.TargetGroupProps{},
1069-
expected: "k8s-myns-myroute-719950e570",
1055+
expected: "k8s-myns-myroute-27d98b9190",
10701056
},
10711057
{
10721058
name: "no props",
1073-
expected: "k8s-myns-myroute-719950e570",
1059+
expected: "k8s-myns-myroute-27d98b9190",
10741060
},
10751061
{
10761062
name: "protocol specified props",
10771063
protocolVersion: &http2,
1078-
expected: "k8s-myns-myroute-ce262fa9fe",
1064+
expected: "k8s-myns-myroute-d2bd5deaa7",
10791065
},
10801066
}
10811067

@@ -1085,7 +1071,7 @@ func Test_buildTargetGroupName(t *testing.T) {
10851071
clusterName: clusterName,
10861072
}
10871073

1088-
result := builder.buildTargetGroupName(tc.targetGroupProps, gwKey, routeKey, svcKey, 80, elbv2model.TargetTypeIP, elbv2model.ProtocolTCP, tc.protocolVersion)
1074+
result := builder.buildTargetGroupName(tc.targetGroupProps, gwKey, routeKey, routeutils.HTTPRouteKind, svcKey, 80, elbv2model.TargetTypeIP, elbv2model.ProtocolTCP, tc.protocolVersion)
10891075
assert.Equal(t, tc.expected, result)
10901076
})
10911077
}

pkg/gateway/routeutils/backend.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ func commonBackendLoader(ctx context.Context, k8sClient client.Client, typeSpeci
9898
// Otherwise, general error. No need for status update.
9999
return nil, errors.Wrap(err, fmt.Sprintf("Unable to fetch svc object %+v", svcIdentifier))
100100
}
101+
102+
// TODO -- This should be updated, to handle UDP and TCP on the same service port.
103+
// Currently, it will just arbitrarily take one.
104+
101105
var servicePort *corev1.ServicePort
102106

103107
for _, svcPort := range svc.Spec.Ports {
@@ -107,19 +111,19 @@ func commonBackendLoader(ctx context.Context, k8sClient client.Client, typeSpeci
107111
}
108112
}
109113

114+
if servicePort == nil {
115+
initialErrorMessage := fmt.Sprintf("Unable to find service port for port %d", *backendRef.Port)
116+
wrappedGatewayErrorMessage := generateInvalidMessageWithRouteDetails(initialErrorMessage, routeKind, routeIdentifier)
117+
return nil, wrapError(errors.Errorf("%s", initialErrorMessage), gwv1.GatewayReasonListenersNotValid, gwv1.RouteReasonBackendNotFound, &wrappedGatewayErrorMessage, nil)
118+
}
119+
110120
tgConfig, err := LookUpTargetGroupConfiguration(ctx, k8sClient, k8s.NamespacedName(svc))
111121

112122
if err != nil {
113123
// As of right now, this error can only be thrown because of a k8s api error hence no status update.
114124
return nil, errors.Wrap(err, fmt.Sprintf("Unable to fetch tg config object"))
115125
}
116126

117-
if servicePort == nil {
118-
initialErrorMessage := fmt.Sprintf("Unable to find service port for port %d", *backendRef.Port)
119-
wrappedGatewayErrorMessage := generateInvalidMessageWithRouteDetails(initialErrorMessage, routeKind, routeIdentifier)
120-
return nil, wrapError(errors.Errorf("%s", initialErrorMessage), gwv1.GatewayReasonListenersNotValid, gwv1.RouteReasonBackendNotFound, &wrappedGatewayErrorMessage, nil)
121-
}
122-
123127
var tgProps *elbv2gw.TargetGroupProps
124128

125129
if tgConfig != nil {

pkg/gateway/routeutils/constants.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ var allRoutes = map[RouteKind]func(context context.Context, client client.Client
2727
}
2828

2929
// Default protocol map used to infer accepted route kinds when a listener doesn't specify the `allowedRoutes` field.
30-
var defaultProtocolToRouteKindMap = map[gwv1.ProtocolType]RouteKind{
31-
gwv1.TCPProtocolType: TCPRouteKind,
32-
gwv1.UDPProtocolType: UDPRouteKind,
33-
gwv1.TLSProtocolType: TLSRouteKind,
34-
gwv1.HTTPProtocolType: HTTPRouteKind,
35-
gwv1.HTTPSProtocolType: HTTPRouteKind,
30+
var defaultProtocolToRouteKindMap = map[gwv1.ProtocolType][]RouteKind{
31+
gwv1.TCPProtocolType: {TCPRouteKind},
32+
gwv1.UDPProtocolType: {UDPRouteKind},
33+
gwv1.TLSProtocolType: {TLSRouteKind, TCPRouteKind},
34+
gwv1.HTTPProtocolType: {HTTPRouteKind},
35+
gwv1.HTTPSProtocolType: {HTTPRouteKind},
3636
}

pkg/gateway/routeutils/listener_attachment_helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func (attachmentHelper *listenerAttachmentHelperImpl) kindCheck(listener gwv1.Li
125125
...
126126
*/
127127
if listener.AllowedRoutes == nil || listener.AllowedRoutes.Kinds == nil || len(listener.AllowedRoutes.Kinds) == 0 {
128-
allowedRoutes = sets.New[RouteKind](defaultProtocolToRouteKindMap[listener.Protocol])
128+
allowedRoutes = sets.New[RouteKind](defaultProtocolToRouteKindMap[listener.Protocol]...)
129129
} else {
130130
// TODO - Not sure how to handle versioning (correctly) here.
131131
// So going to ignore the group checks for now :x

0 commit comments

Comments
 (0)