-
Notifications
You must be signed in to change notification settings - Fork 98
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
Maintain the order from the Gateway resource #1324
Conversation
✅ Deploy Preview for nginx-gateway-fabric ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
8c69c8f
to
f3cffe6
Compare
Hi @mpstefan, I have just added a description to this PR and would appreciate some early feedback before dedicating more time to testing and refining it. Although the solution is quite simple, involving only the change of two maps to two slices, this PR affects a large number of files. I am not sure if my solution is too complex or not. Because it is a good first issue, I expect I can fix it in less than 50 LoC. Do I miss anything? Thanks! |
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.
@kevin85421 thanks for working on this!
The approach looks good to me. I just left a few small suggestions.
We'll wait to merge this until after our upcoming release. |
4cc8cd0
to
38a5fab
Compare
Thanks, @kate-osborn and @sjberman! I have already squashed the commits and added a detailed commit message to it. Feel free to let me know if I need to rebase this PR after the release. Thanks! |
One small nitpick, can you update your commit message to remove links? Lines change over time and those links won't have much value. It's better just to mention what the issue is and what the solution is. |
* Problem: The status of the Gateway does not correspond to the order of `Spec.Listeners`. * Solution: * The order of the `v1.GatewayStatus.Listeners` depends on `GatewayStatus.ListenerStatuses`. However, `GatewayStatus.ListenerStatuses` is a map `map[string]ListenerStatus` which the order of iteration is not guaranteed. * [1] This PR changes the type of `GatewayStatus.ListenerStatuses` from map to slice. * However, [1] is not enough. The order of `GatewayStatus.ListenerStatuses` is based on the order of `graph.Gateway.Listeners`, but the type of `graph.Gateway.Listeners` is also a map. * This PR changes `Gateway.Listeners` from a map to a slice.
38a5fab
to
0a8ee50
Compare
Updated. Thanks! |
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.
hi @kevin85421 thanks for the PR! Please see my feedback
Improve comments Co-authored-by: Michael Pleshakov <[email protected]>
Keep values instead of introducing new functions
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.
👍 🚀
Proposed changes
Problem: The status of the Gateway does not correspond to the order of
Spec.Listeners
.Solution: Explain the approach you took to implement the solution, highlighting any significant design decisions or
considerations.
GatewayStatus.ListenerStatuses
is a map (map[string]ListenerStatus) which the order of iteration is not guaranteed.GatewayStatus.ListenerStatuses
from map to slice.GatewayStatus.ListenerStatuses
is based on the order of graph.Gateway.Listeners, but the type of graph.Gateway.Listeners is also a map.Gateway.Listeners
from a map to a slice.Testing:
TestBuildGateway
) for more details.Closes #689
Checklist
Before creating a PR, run through this checklist and mark each as complete.