fix ListenerSetHostnameConflict/ListenerSetProtocolConflict conformance test#8361
fix ListenerSetHostnameConflict/ListenerSetProtocolConflict conformance test#8361zirain wants to merge 3 commits into
Conversation
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8361 +/- ##
==========================================
+ Coverage 74.34% 74.39% +0.04%
==========================================
Files 244 244
Lines 38768 38935 +167
==========================================
+ Hits 28824 28967 +143
- Misses 7950 7962 +12
- Partials 1994 2006 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1663b4e to
668e7f7
Compare
|
Hi @zirain can we split ListenerSetHostnameConflict/ListenerSetProtocolConflict fixes into two PRs, it will be easier to review. |
9ee8b95 to
c861521
Compare
c861521 to
a6d8112
Compare
5ae7a19 to
d1c0767
Compare
Splited. |
d1c0767 to
8d5a5d9
Compare
|
kubernetes-sigs/gateway-api#4618
Hi @zirain can you confirm if the conformance test could pass without adding the |
|
bfd2b62 to
36fa1bc
Compare
43de278 to
513cee2
Compare
513cee2 to
3795153
Compare
3349e94 to
19c01ac
Compare
6fc7803 to
7bc5d9c
Compare
|
@jukie @zhaohuabing can you take a review again? |
| for _, gateway := range gateways { | ||
| portListenerInfo := map[gwapiv1.PortNumber]*portListeners{} | ||
| for _, listener := range gateway.listeners { | ||
| if listener.Protocol == gwapiv1.UDPProtocolType || listener.Protocol == gwapiv1.TCPProtocolType { |
There was a problem hiding this comment.
Unsupported listeners should probably be skipped in hostname conflict checks too. Otherwise an invalid-first listener can still win hostname precedence and cause a later valid listener on the same hostname/port to be marked HostnameConflict.
There was a problem hiding this comment.
Not opposed to it being in a follow-up either
| if countInt32 > 0 { | ||
| g.Status.AttachedListenerSets = ptr.To(countInt32) | ||
| } | ||
| return |
There was a problem hiding this comment.
if we return here, arent we avoid an increment ?
There was a problem hiding this comment.
if we reach here, that means new count is 0 and AttachedListenerSets is nil, so it's safe to skip.
59f59cb to
58a2796
Compare
e37f5c2 to
9b7180d
Compare
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
9b7180d to
68da39b
Compare
| specValid := t.validateAllowedNamespaces(listener) | ||
| if !validateProtocolRules(listener) { | ||
| specValid = false | ||
| } | ||
|
|
||
| // Phase 2: Validate allowed routes based on protocol | ||
| if listener.Protocol == gwapiv1.HTTPProtocolType || | ||
| listener.Protocol == gwapiv1.HTTPSProtocolType || | ||
| listener.Protocol == gwapiv1.TCPProtocolType || | ||
| listener.Protocol == gwapiv1.UDPProtocolType || | ||
| listener.Protocol == gwapiv1.TLSProtocolType { | ||
| var tlsMode *gwapiv1.TLSModeType | ||
| if listener.TLS != nil { | ||
| tlsMode = listener.TLS.Mode | ||
| } | ||
| allowedKinds := allowedRouteKindsForProtocol(listener.Protocol, tlsMode) | ||
| if !t.validateAllowedRoutes(listener, allowedKinds...) { | ||
| specValid = false | ||
| } | ||
| } else { |
There was a problem hiding this comment.
Can this be reworked or simplified? The else block effectively covers the !validateProtocolRules case if I'm reading correctly.
There was a problem hiding this comment.
that's why I want merge #8577 first, will make this one cleaner.
Co-authored-by: Isaac Wilson <isaac.wilson514@gmail.com> Signed-off-by: zirain <zirain2009@gmail.com>
|
Can you add a release note too |
|
replaced by #8910 |
Fix ListenerSetHostnameConflict conformance test
IncreaseAttachedListenerSetsonly increase when ListenerSet is valid