-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: ir.TCPListener to support one to many listener to routes #1798
Conversation
Signed-off-by: David Boslee <david@goteleport.com>
Codecov Report
@@ Coverage Diff @@
## main #1798 +/- ##
==========================================
- Coverage 66.12% 65.93% -0.20%
==========================================
Files 86 86
Lines 12868 12898 +30
==========================================
- Hits 8509 8504 -5
- Misses 3832 3864 +32
- Partials 527 530 +3
|
Signed-off-by: David Boslee <david@goteleport.com>
Signed-off-by: David Boslee <david@goteleport.com>
return fmt.Sprintf("%s/%s/%s", listener.gateway.Namespace, listener.gateway.Name, listener.Name) | ||
} | ||
|
||
func irTLSListenerName(listener *ListenerContext, tlsRoute *TLSRouteContext) string { | ||
func irTLSRouteName(listener *ListenerContext, tlsRoute *TLSRouteContext) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does listener
need to be part of the name, can this helper look more like irRouteName
w/o the the matchIdx
return fmt.Sprintf("%s/%s/%s/%s", listener.gateway.Namespace, listener.gateway.Name, listener.Name, tlsRoute.Name) | ||
} | ||
|
||
func irTCPListenerName(listener *ListenerContext, tcpRoute *TCPRouteContext) string { | ||
func irTCPRouteName(listener *ListenerContext, tcpRoute *TCPRouteContext) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does listener
need to be part of the name, can this helper look more like irRouteName
w/o the the matchIdx
@@ -119,6 +119,13 @@ func (t *Translator) ProcessListeners(gateways []*GatewayContext, xdsIR XdsIRMap | |||
irListener.Hostnames = append(irListener.Hostnames, "*") | |||
} | |||
gwXdsIR.HTTP = append(gwXdsIR.HTTP, irListener) | |||
case v1beta1.TCPProtocolType, v1beta1.TLSProtocolType: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont we need to set irListener.Hostnames
for TLS
?
https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io%2fv1beta1.Listener
@@ -679,7 +679,16 @@ type TCPListener struct { | |||
Address string `json:"address" yaml:"address"` | |||
// Port on which the service can be expected to be accessed by clients. | |||
Port uint32 `json:"port" yaml:"port"` | |||
// TLS holds information for configuring TLS on a listener | |||
// Routes associated with TCP traffic to the listener. | |||
Routes []*TCPRoute `json:"routes" yaml:"routes"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Routes []*TCPRoute `json:"routes" yaml:"routes"` | |
Routes []*TCPRoute `json:"routes,omitempty" yaml:"routes,omitempty"` |
thanks @dboslee, looks mostly good, added some comments |
Was OOO, I will circle back to this in the next few days. |
np thanks @dboslee |
@dboslee checking in to see if you are still actively working on this PR |
Takes forward PR envoyproxy#1798 Fixes: envoyproxy#1635 Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Takes forward PR envoyproxy#1798 Fixes: envoyproxy#1635 Signed-off-by: Arko Dasgupta <arko@tetrate.io>
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, when it's ready. Thank you for your contributions! |
Takes forward PR envoyproxy#1798 Fixes: envoyproxy#1635 Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Takes forward PR envoyproxy#1798 Fixes: envoyproxy#1635 Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Takes forward PR envoyproxy#1798 Fixes: envoyproxy#1635 Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Takes forward PR envoyproxy#1798 Fixes: envoyproxy#1635 Signed-off-by: Arko Dasgupta <arko@tetrate.io>
closing in favor of #3271 |
* Refactor IR creation for TLSRoute Takes forward PR #1798 Fixes: #1635 Signed-off-by: Arko Dasgupta <arko@tetrate.io> * pass lint Signed-off-by: Dingkang Li <dingkang1743@gmail.com> --------- Signed-off-by: Arko Dasgupta <arko@tetrate.io> Signed-off-by: Dingkang Li <dingkang1743@gmail.com> Co-authored-by: Arko Dasgupta <arko@tetrate.io>
What this PR does / why we need it:
This change refactors the ir.TCPListener to be named directly after the corresponding gateway listener. The tcp/tls routes map to TCPRoutes attached to the TCPListener.
Which issue(s) this PR fixes:
Fixes #1635