Skip to content
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

node/manager: Utilize set.SliceSubsetOf in ipcache deletion #25180

Merged

Conversation

christarazi
Copy link
Member

@christarazi christarazi commented Apr 28, 2023

  • pkg/set: Support cases where input can be nil
  • node/manager: Utilize set.SliceSubsetOf in ipcache deletion

Copying the more relevant commit for ease of review:

node/manager: Utilize set.SliceSubsetOf in ipcache deletion

This cleans up the code to have proper diffing logic when delete node
IPs from the ipcache. Previously, the logic had a potential for a bug
because it assumed that oldIPs and newIPs were sorted.

FWIW, no bug has been reported in regards to the previous code fixed by
this commit, so it's theoretical for now. In the end, this is a
defensive change to prevent it from happening.

Additionally, this commit will ease the changes that will be introduced
in https://github.com/cilium/cilium/pull/23208.

@christarazi christarazi added kind/enhancement This would improve or streamline existing functionality. sig/policy Impacts whether traffic is allowed or denied based on user-defined policies. release-note/misc This PR makes changes that have no direct user impact. labels Apr 28, 2023
@christarazi

This comment was marked as outdated.

@christarazi christarazi added area/daemon Impacts operation of the Cilium daemon. and removed sig/policy Impacts whether traffic is allowed or denied based on user-defined policies. labels Apr 28, 2023
@christarazi christarazi changed the title pr/christarazi/nodemanager ipcache diff node/manager: Utilize set.SliceSubsetOf in ipcache deletion Apr 28, 2023
@christarazi christarazi force-pushed the pr/christarazi/nodemanager-ipcache-diff branch from 07da8ce to f0426a6 Compare April 28, 2023 01:10
@christarazi

This comment was marked as outdated.

@christarazi christarazi force-pushed the pr/christarazi/nodemanager-ipcache-diff branch 2 times, most recently from d56bd82 to 47fcc78 Compare May 11, 2023 23:40
@christarazi christarazi marked this pull request as ready for review May 11, 2023 23:41
@christarazi christarazi requested review from a team as code owners May 11, 2023 23:41
@christarazi
Copy link
Member Author

/test

Copy link
Member

@pippolo84 pippolo84 left a comment

Choose a reason for hiding this comment

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

LGTM overall, I've just left a suggestion to improve SliceSubsetOf.

pkg/set/set.go Outdated Show resolved Hide resolved
pkg/set/set_test.go Show resolved Hide resolved
@christarazi christarazi force-pushed the pr/christarazi/nodemanager-ipcache-diff branch from 47fcc78 to 5e126fd Compare May 12, 2023 16:41
This will be used in upcoming commits when the main set can be nil.

Signed-off-by: Chris Tarazi <chris@isovalent.com>
This cleans up the code to have proper diffing logic when delete node
IPs from the ipcache. Previously, the logic had a potential for a bug
because it assumed that oldIPs and newIPs were sorted.

FWIW, no bug has been reported in regards to the previous code fixed by
this commit, so it's theoretical for now. In the end, this is a
defensive change to prevent it from happening.

Additionally, this commit will ease the changes that will be introduced
in cilium#23208.

Signed-off-by: Chris Tarazi <chris@isovalent.com>
@christarazi christarazi force-pushed the pr/christarazi/nodemanager-ipcache-diff branch from 5e126fd to c56683b Compare May 12, 2023 16:41
@christarazi
Copy link
Member Author

/test

Copy link
Member

@pippolo84 pippolo84 left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@christarazi
Copy link
Member Author

Marking ready to merge as we have approving reviews and the Travis failure is due to images missing, but it's not required as the integrations test job (test the same thing AFAIK) succeeded.

@christarazi christarazi added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label May 12, 2023
@aditighag aditighag merged commit 5261f07 into cilium:main May 15, 2023
57 of 58 checks passed
@christarazi christarazi deleted the pr/christarazi/nodemanager-ipcache-diff branch May 15, 2023 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/daemon Impacts operation of the Cilium daemon. kind/enhancement This would improve or streamline existing functionality. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants