Implement the service endpoints controller#17216
Merged
Conversation
509271c to
300b669
Compare
9b31ba2 to
fafa53f
Compare
boxofrad
reviewed
May 5, 2023
95ae401 to
73b732c
Compare
fafa53f to
0c04e93
Compare
6517df1 to
a465a8c
Compare
analogue
reviewed
May 12, 2023
internal/catalog/internal/controllers/endpoints/workload_mapper.go
Outdated
Show resolved
Hide resolved
7e5e873 to
5dc5051
Compare
0c04e93 to
f608a7f
Compare
5dc5051 to
de295b1
Compare
f608a7f to
d8c7a49
Compare
de295b1 to
edb2b71
Compare
d8c7a49 to
874f2ce
Compare
f23cbd8 to
995d3b7
Compare
ishustava
reviewed
May 23, 2023
Contributor
ishustava
left a comment
There was a problem hiding this comment.
I'm still reviewing but thought I'd leave comments I had so far!
internal/catalog/internal/mappers/selectiontracker/selection_tracker.go
Outdated
Show resolved
Hide resolved
f1104b5 to
0c553de
Compare
ishustava
approved these changes
May 24, 2023
Contributor
ishustava
left a comment
There was a problem hiding this comment.
Looks great! I had a few more comments, but won't block the merge on those.
0c553de to
96d57f4
Compare
6210f47 to
ab8e1b8
Compare
This also fixes a bug where multiple service ports with a 0 value virtual port could not be set. A 0 virtual port means unset and so we should allow duplicates of these.
ab8e1b8 to
7f6fb90
Compare
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
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.
Description
This PR builds on #17215. The workload mapper tracks which services each workload is a part of. When reconciling service endpoints, the controller will aggregate view all the status information of workloads in order to populate the HealthStatus field on the ServiceEndpoints. The final result is that the ServiceEndpoints types get computed for all services.
To make the workload to service mapping more efficient it uses a radix tree. I copied this from github.com/armon/go-radix and then modified that to be a generic type. Mainly I didn't want to type coerce from interface{} all over the place. This could probably also have used a generic version of github.com/hashicorp/go-immutable-radix.S
Testing & Reproduction steps
PR Checklist