-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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(policy): generalize route types in outbound index #12664
Merged
adleong
merged 19 commits into
linkerd:main
from
the-wondersmith:policy-refactor-index-outbound-generalize-route-types
Jun 5, 2024
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
2c08f77
refactor: preliminary name changes to make route types generic
the-wondersmith b6dbafc
style: cargo fmt
the-wondersmith c053346
revert: revert lock changes
the-wondersmith b397fe8
refactor: generalize outbound route types
the-wondersmith ce8a72e
Merge branch 'main' into policy-refactor-index-outbound-generalize-ro…
the-wondersmith be33011
revert(deps): revert lockfile changes
the-wondersmith acf6102
revert(deps): revert dep changes
the-wondersmith 229d892
chore(deps): fix bad lockfile update
the-wondersmith 124d390
Merge remote-tracking branch 'refs/remotes/origin/main' into policy-r…
the-wondersmith 584fd1b
style: consolidate imports from same crate
the-wondersmith c90c5fd
chore: remove resolved todo
the-wondersmith fb040c9
style: revert `for_each` calls back to explicit for loops
the-wondersmith ac269f0
refactor: add Empty variant to OutboundRouteType
the-wondersmith 61faf69
Merge branch 'main' into policy-refactor-index-outbound-generalize-ro…
the-wondersmith 153e350
perf: improve implementation of `insert` and `remove`
the-wondersmith ad46e78
perf: remove unnecessary emptiness check
the-wondersmith 817907c
style: revert change to filter vs if in ServiceRoutes::apply
the-wondersmith 92d4ccb
Merge branch 'main' into policy-refactor-index-outbound-generalize-ro…
the-wondersmith 259fc2c
bump
the-wondersmith File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
What do you think of adding an
Empty
variant to this enum and then making routes anOutboundRouteCollection
instead of anOption<OutboundRouteCollection>
. (we would use OutboundRouteCollection::Empty instead of None)The advantage of this is it lets this type internalize more of the state logic. E.g. calling insert with an HttpRoute while in the Empty state transitions to the OutboundRouteCollection::Http state. Calling insert with a GrpcRoute while in the Http state returns an error. Calling remove which causes the HashMap to become empty transitions it to the Empty state. etc. etc.
Internalizing this state logic lets us get rid of functions like
default_collection_for
.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.
I agree with all of that. I went the
Option
route to reduce the diff, the amount of additional/future code maintenance introduced, etc...If there's buy in for it, I think your suggestion would for sure be a more polished way to go
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.
@adleong implemented and pushed the changes to make this happen. Looking forward to your thoughts