Skip to content

fix: set correct listenerContext order#535

Merged
arkodg merged 1 commit intoenvoyproxy:mainfrom
Xunzhuo:fix-listener-order
Oct 10, 2022
Merged

fix: set correct listenerContext order#535
arkodg merged 1 commit intoenvoyproxy:mainfrom
Xunzhuo:fix-listener-order

Conversation

@Xunzhuo
Copy link
Member

@Xunzhuo Xunzhuo commented Oct 10, 2022

Fixes: #533

Signed-off-by: bitliu bitliu@tencent.com

@Xunzhuo Xunzhuo marked this pull request as ready for review October 10, 2022 09:21
@Xunzhuo Xunzhuo requested a review from a team as a code owner October 10, 2022 09:21
@codecov-commenter
Copy link

Codecov Report

Merging #535 (bb4cee1) into main (b8f234b) will increase coverage by 0.09%.
The diff coverage is 62.50%.

@@            Coverage Diff             @@
##             main     #535      +/-   ##
==========================================
+ Coverage   62.72%   62.81%   +0.09%     
==========================================
  Files          42       42              
  Lines        4496     4497       +1     
==========================================
+ Hits         2820     2825       +5     
+ Misses       1532     1529       -3     
+ Partials      144      143       -1     
Impacted Files Coverage Δ
internal/gatewayapi/contexts.go 77.51% <50.00%> (+0.13%) ⬆️
internal/gatewayapi/helpers.go 66.66% <100.00%> (ø)
internal/provider/kubernetes/gatewayclass.go 73.91% <0.00%> (+2.89%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Signed-off-by: bitliu <bitliu@tencent.com>
@Xunzhuo Xunzhuo force-pushed the fix-listener-order branch from e379463 to 11d6afa Compare October 10, 2022 09:44
@Xunzhuo Xunzhuo changed the title fix: set listener Context order fix: set correct listenerContext order Oct 10, 2022

if ctx := g.listeners[listenerName]; ctx != nil {
return ctx
for _, l := range g.listeners {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we take this approach of implicitly relying on input listener order, we'll no longer need to sort the listener Names in the o/p, can you also rm

sort.SliceStable(ir.HTTP, func(i, j int) bool { return ir.HTTP[i].Name < ir.HTTP[j].Name })

@arkodg arkodg mentioned this pull request Oct 10, 2022
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for fixing this issue ! this does make listener retrieval a little slower but it easier code to manage rather than add sort functions in the o/p

@arkodg arkodg merged commit ce1aa35 into envoyproxy:main Oct 10, 2022
arkodg pushed a commit to arkodg/gateway that referenced this pull request Oct 10, 2022
No longer needed now that order is maintained
by using a list, thanks to envoyproxy#535

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
arkodg added a commit that referenced this pull request Oct 11, 2022
No longer needed now that order is maintained
by using a list, thanks to #535

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
@Xunzhuo Xunzhuo deleted the fix-listener-order branch October 11, 2022 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Translate httproute with N listeners Order failed

3 participants