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
pkg/proxy: use generic sets #117386
pkg/proxy: use generic sets #117386
Conversation
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
ce5d65e
to
577fc84
Compare
/retest |
/release-note-none |
/lgtm I did a quick skim, it will be good another pair of eyes |
LGTM label has been added. Git tree hash: 4924b78209f984df718db4aefe5f5bc9dfcd09d5
|
pkg/proxy/ipvs/proxier.go
Outdated
@@ -2006,7 +2006,7 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode | |||
} | |||
|
|||
// Delete old endpoints | |||
for _, ep := range curEndpoints.Difference(newEndpoints).UnsortedList() { | |||
for _, ep := range sets.List(curEndpoints.Difference(newEndpoints)) { |
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.
lol, now you're just messing with me!
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.
@danwinship lol, no !
one of the ipvs unit test fails, expects sorted ordering:
kubernetes/pkg/proxy/ipvs/proxier_test.go
Lines 4430 to 4433 in f66e1a3
assert.Equal(t, realServers1[0].String(), "10.0.1.1:80") | |
assert.Equal(t, realServers1[1].String(), "10.0.1.2:80") | |
assert.Equal(t, realServers1[2].String(), "10.0.1.3:80") | |
So I updated the set iterations in IPVS to use sorted order. I narrowed it down, if I make the following unordered the test case fails
kubernetes/pkg/proxy/ipvs/proxier.go
Line 1882 in f66e1a3
for _, ep := range newEndpoints.List() { |
should I update the test case in another commit to compare the arrays independent of the order ?
577fc84
to
82ab464
Compare
82ab464
to
307d71a
Compare
pkg/proxy: using generic sets Signed-off-by: Daman <aroradaman@gmail.com>
Signed-off-by: Daman <aroradaman@gmail.com>
/lgtm What happened with the ipvs unit test thing? Did that turn out to be caused by another change you'd made somewhere else? |
LGTM label has been added. Git tree hash: 39627929048a2d88a66b6d68cde8212f29f4b4fb
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: daman1807, danwinship The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Replace typed sets with new generic sets
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
For logging and debugging statements, I have used Unsorted ordering to get all elements of the set. In other places I have used sorted ordering
sets.List
as some test cases were dependent on the ordering.Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: