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

fix: ipam clean all pod nic ip address and mac even if just delete a nic #3453

Merged
merged 4 commits into from
Dec 1, 2023

Conversation

zbb88888
Copy link
Collaborator

@zbb88888 zbb88888 commented Nov 23, 2023

Pull Request

What type of this PR

Examples of user facing changes:

  • Features
  • Bug fixes

解决 vm pod 换一张网卡的时候会把所有 ip 释放的问题

  • Docs
  • Tests

Which issue(s) this PR fixes

Fixes #(issue-number)

WHAT

🤖[deprecated] Generated by Copilot at c33b81e

This pull request improves the IPAM module by modifying the ReleaseAddressByPod function and its callers to handle different scenarios of subnet change and pod deletion. It also refactors and fixes some logic in the iptables EIP and OVN EIP controllers, and updates the test and benchmark code accordingly. The changes enhance the performance, correctness, and logging of the IPAM and EIP features.

🤖[deprecated] Generated by Copilot at c33b81e

Sing, O Muse, of the mighty deeds of the code reviewers,
Who with keen eyes and skillful words improved the IPAM module,
That wondrous tool that allocates and releases IP addresses
For pods and nodes and switches and external IPs alike.

HOW

🤖[deprecated] Generated by Copilot at c33b81e

  • Modify the ReleaseAddressByPod function in the IPAM package to release the IP address only from the specified subnet if it is not empty, or from all the subnets if it is empty (link)
  • Update the controller functions that call the ReleaseAddressByPod function to pass the subnet name as a parameter, and add log messages where appropriate (link, link, link, link, link, link, link, link, link, link)
  • Simplify the logic for handling the deletion of an iptables external IP by moving the finalizer function call to the handleDelIptablesEip function, and check if the iptables EIP CR exists before deleting it (link, link)
  • Adapt the test and benchmark code for the IPAM package to the change in the ReleaseAddressByPod function by passing an empty string as the subnet name (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)

@zbb88888 zbb88888 force-pushed the fix-ipam-clean-only-one-pod-nic branch from d195108 to e6f1d32 Compare November 30, 2023 01:27
@zbb88888 zbb88888 requested a review from oilbeater November 30, 2023 02:56
@zbb88888
Copy link
Collaborator Author

zbb88888 commented Dec 1, 2023

@oilbeater 这个之前1.11的已经合入了,已经review 过了

@zbb88888 zbb88888 merged commit f257003 into kubeovn:master Dec 1, 2023
59 checks passed
zbb88888 added a commit that referenced this pull request Dec 1, 2023
…nic (#3453)

* fix: ipam clean all pod nic ip address and mac even if just delete a nic
---------

Signed-off-by: bobz965 <[email protected]>
zbb88888 added a commit that referenced this pull request Dec 6, 2023
…nic (#3453)

* fix: ipam clean all pod nic ip address and mac even if just delete a nic
---------

Signed-off-by: bobz965 <[email protected]>
@zbb88888 zbb88888 deleted the fix-ipam-clean-only-one-pod-nic branch December 11, 2023 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant