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

underlay: fix ip/route tranfer when the nic is managed by NetworkManager #3184

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

zhangzujian
Copy link
Member

@zhangzujian zhangzujian commented Sep 5, 2023

What type of this PR

Examples of user facing changes:

  • Features
  • Bug fixes
  • Docs
  • Tests

Which issue(s) this PR fixes:

Fixes #(issue-number)

WHAT

🤖 Generated by Copilot at c723486

This pull request updates some dependencies, refactors and improves some code related to provider network initialization and synchronization, and fixes a bug in address and route transfer. The main purpose is to enhance the network management and UUID handling capabilities of the project.

🤖 Generated by Copilot at c723486

Sing, O Muse, of the valiant deeds of the code warriors
Who updated the go.mod file with new modules of power
And refactored the code of the Controller and its networks
To make them more modular, testable, and free of defects

HOW

🤖 Generated by Copilot at c723486

  • Refactor the code to make the configExternalBridge and removeProviderNic functions methods of the Controller struct, to improve modularity and testability (link, link, link, link, link)
  • Add the networkManagerSyncer struct and its methods in nm_linux.go, to synchronize the IP addresses and routes of the host network interfaces with the OVS bridges (link)
  • Modify the Run method of the networkManagerSyncer struct to subscribe to the PropertiesChanged signals of the IP4Config and IP6Config interfaces, instead of the StateChanged signal of the ActiveConnection interface, to better detect the changes in the IP addresses and routes of the devices (link, link, link)
  • Modify the RemoveDevice method of the networkManagerSyncer struct to have no return value and to remove the redundant return statement, to simplify the code (link, link)
  • Modify the transferAddrsAndRoutes function in ovs_linux.go to use a count variable to keep track of the number of addresses that were added or replaced on the bridge link, and to only delete the addresses and routes from the bridge link if the count variable is not zero, to avoid deleting the addresses and routes that were not transferred from the host nic (link, link, link, link)
  • Update the go.mod file to use newer versions of the github.com/kubeovn/gonetworkmanager/v2 and github.com/google/uuid modules (link, link)

@zhangzujian zhangzujian added bug Something isn't working need backport labels Sep 5, 2023
@zhangzujian zhangzujian marked this pull request as ready for review September 6, 2023 01:42
@zhangzujian zhangzujian merged commit 371d7c3 into kubeovn:master Sep 7, 2023
@zhangzujian zhangzujian deleted the fix-nm branch September 7, 2023 04:02
zhangzujian added a commit that referenced this pull request Sep 7, 2023
zhangzujian added a commit that referenced this pull request Sep 7, 2023
zhangzujian added a commit that referenced this pull request Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need backport
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants