Support HTTPRoute destination port matching

This commit is contained in:
Kevin Pollet 2024-09-27 12:12:05 +02:00 committed by GitHub
parent eccfcc0924
commit d317cd90fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 28 additions and 25 deletions

View file

@ -112,6 +112,7 @@ type ExtensionBuilderRegistry interface {
type gatewayListener struct {
Name string
Port gatev1.PortNumber
Protocol gatev1.ProtocolType
TLS *gatev1.GatewayTLSConfig
Hostname *gatev1.Hostname
@ -429,6 +430,7 @@ func (p *Provider) loadGatewayListeners(ctx context.Context, gateway *gatev1.Gat
GWName: gateway.Name,
GWNamespace: gateway.Namespace,
GWGeneration: gateway.Generation,
Port: listener.Port,
Protocol: listener.Protocol,
TLS: listener.TLS,
Hostname: listener.Hostname,
@ -1118,6 +1120,10 @@ func matchListener(listener gatewayListener, routeNamespace string, parentRef ga
return false
}
if parentRef.Port != nil && *parentRef.Port != listener.Port {
return false
}
return true
}