Skip to content

Conversation

ldlb9527
Copy link
Contributor

@ldlb9527 ldlb9527 commented Sep 4, 2024

fixes: #34677

Make LB-IPAM allow IP sharing between services with the same ports but different protocols

@ldlb9527 ldlb9527 requested a review from a team as a code owner September 4, 2024 16:53
@ldlb9527 ldlb9527 requested a review from ysksuzuki September 4, 2024 16:53
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Sep 4, 2024
@github-actions github-actions bot added the kind/community-contribution This was a contribution made by a community member. label Sep 4, 2024
@joestringer joestringer added the release-note/bug This PR fixes an issue in a previous release of Cilium. label Sep 5, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Sep 5, 2024
@ysksuzuki
Copy link
Member

@dylandreimerink Would you mind taking look at this PR? You have the most context on #34677

Copy link
Member

@dylandreimerink dylandreimerink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This is great, just want to simplify a little

@dylandreimerink
Copy link
Member

dylandreimerink commented Sep 9, 2024

I have two requests that I forgot to add to the initial review. The first being, could you please add a test case. We already have one that asserts the non-overlapping ports, you should be able to copy it and modify it, set the service differentiation setting in the new case and make the two services use UDP and TCP on the same port, assert they get the same IP assigned.

func TestSharedServiceUpdatedPorts(t *testing.T) {

My second request is to slightly change the way we plumb in the service differentiation setting. The current way uses the global variable, which may cause issues during testing since changing it persists across test cases. What I suggest instead is to use the config object that is already provided.

DaemonConfig *option.DaemonConfig

You can add a new boolean here for the setting and set it here

Finally, add a new boolean to the isCompatible function and plumb the config value to it via its callsites.

I hope that made sense 😅. Its a few additional lines of code, but it makes this piece of code easier to test without the global variable usage, so worth it

@ldlb9527 ldlb9527 requested review from a team as code owners September 9, 2024 19:11
@ldlb9527
Copy link
Contributor Author

ldlb9527 commented Sep 9, 2024

hi @dylandreimerink, I have improved this PR, but I didn’t use the DaemonConfig you mentioned. I’m not sure if this is correct.

Copy link
Member

@dylandreimerink dylandreimerink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I was after, thank you!

Copy link
Contributor

@tommyp1ckles tommyp1ckles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thank you

@ysksuzuki ysksuzuki removed their request for review September 11, 2024 06:08
@youngnick
Copy link
Contributor

/test

@dylandreimerink
Copy link
Member

/test

Copy link
Contributor

@ldelossa ldelossa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@aanm aanm enabled auto-merge October 11, 2024 10:15
@aanm
Copy link
Member

aanm commented Oct 11, 2024

/test

fixes: cilium#34677

Signed-off-by: cx <1249843194@qq.com>
fixes: cilium#34677

Signed-off-by: cx <1249843194@qq.com>
@julianwiedmann
Copy link
Member

Let's see if a rebase helps to resolve the one CI fail in e2e-upgrade.

@julianwiedmann
Copy link
Member

/test

@aanm aanm added this pull request to the merge queue Oct 21, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Oct 21, 2024
Merged via the queue into cilium:main with commit 99606ef Oct 21, 2024
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/lb-ipam kind/community-contribution This was a contribution made by a community member. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LB-IPAM: Account for protocol differentiation in IP sharing checks
9 participants