-
Notifications
You must be signed in to change notification settings - Fork 647
refactor: convert IR map fields to slices to ensure deterministic Dee… #7953
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
Open
Junnygram
wants to merge
6
commits into
envoyproxy:main
Choose a base branch
from
Junnygram:refactor/ir-map-to-slice
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for cerulean-figolla-1f9435 canceled.
|
a34560c to
e1ab70a
Compare
…pEqual Addresses issue envoyproxy#7852. Signed-off-by: Junnygram <[email protected]>
e1ab70a to
e53faad
Compare
jukie
requested changes
Jan 16, 2026
… mismatch Signed-off-by: Junnygram <[email protected]>
536eef8 to
0f04f7a
Compare
71aa5ec to
8853dd2
Compare
arkodg
reviewed
Jan 17, 2026
internal/ir/utils.go
Outdated
| for k, v := range m { | ||
| res = append(res, MapEntry{Key: k, Value: v}) | ||
| } | ||
| slices.SortFunc(res, func(a, b MapEntry) int { |
Contributor
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.
nit: can you check if this style
| sort.Slice(r.Gateways, func(i, j int) bool { |
Contributor
|
thanks @Junnygram this is great ! |
Use sort.Slice instead of slices.SortFunc and cmp.Compare. Fix undefined apisv1 in zz_generated.deepcopy.go. Signed-off-by: Junnygram <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
refactor: convert IR map fields to slices to ensure deterministic DeepEqual
This PR refactors the Intermediate Representation (IR) to replacing map fields with slices of structs. This ensures consistent ordering of elements, which is critical for deterministic
DeepEqualcomparisons and preventing unnecessary xDS updates.Key changes:
map[string]stringwith[]MapEntryin IR structs.map[string]CustomTagwith[]CustomTagMapEntry.TrafficFeatures.Telemetryfrom API types to enforce slice usage.gatewayapitranslator to convert API maps to sorted IR slices.xds/translatorto consume slice-based IR.Fixes #7852.