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: sync NetworkManager IP config to OVS bridge #2949

Merged
merged 3 commits into from
Jun 19, 2023

Conversation

zhangzujian
Copy link
Member

@zhangzujian zhangzujian commented Jun 16, 2023

What type of this PR

  • Features

Which issue(s) this PR fixes:

Fixes #(issue-number)

WHAT

🤖 Generated by Copilot at 4aa324c

This pull request adds a new feature to support NetworkManager on Linux nodes by creating a networkManagerSyncer type that syncs network configuration between NetworkManager and OVS bridges. It also refactors the controller code to use receiver methods instead of global functions for provider network initialization and cleanup, improving modularity and testability. The changes affect the files pkg/daemon/controller_linux.go, pkg/daemon/controller.go, pkg/daemon/init_linux.go, pkg/daemon/init.go, pkg/daemon/ovs_linux.go, pkg/daemon/init_windows.go, and pkg/daemon/nm_linux.go.

🤖 Generated by Copilot at 4aa324c

To sync OVS bridges and NetworkManager
We added a new type and a syncer
We also refactored
The controller methods
And used receivers instead of global handler

HOW

🤖 Generated by Copilot at 4aa324c

  • Add a new type networkManagerSyncer and its methods to handle the synchronization of network configuration between NetworkManager and OVS bridges on Linux nodes (link)
  • Add a field nmSyncer *networkManagerSyncer to the Controller struct to store a reference to the network manager syncer instance (link)
  • Initialize and run the network manager syncer in the initRuntime function of the controller (link)
  • Refactor the functions ovsInitProviderNetwork, ovsCleanProviderNetwork, configProviderNic, and changeProvideNicName to use the receiver c *Controller instead of global functions, making the code more modular and testable (link, link, link, link, link, link, link, link, link, link)
  • Remove the unused import statement and function nmSetManaged from the file pkg/daemon/init_linux.go as they are no longer needed (link, link)
  • Remove the redundant code to configure the provider NIC in the InitOVSBridges function as it is now handled by the network manager syncer (link)
  • Set the provider NIC unmanaged by NetworkManager and add it to the network manager syncer in the configProviderNic function (link)
  • Use the network manager syncer instance to set the provider NIC managed or unmanaged by NetworkManager in the changeProvideNicName function (link)

@zhangzujian zhangzujian added the feature New network feature label Jun 16, 2023
@zhangzujian zhangzujian force-pushed the underlay branch 3 times, most recently from 8cc9af9 to 0096370 Compare June 16, 2023 02:18
@zhangzujian zhangzujian force-pushed the underlay branch 2 times, most recently from 4a8e415 to 0b84d67 Compare June 16, 2023 02:42
@zhangzujian zhangzujian marked this pull request as ready for review June 16, 2023 03:45
@oilbeater
Copy link
Collaborator

need backport to 1.9

@zhangzujian zhangzujian merged commit 30ea6d6 into kubeovn:master Jun 19, 2023
@zhangzujian zhangzujian deleted the underlay branch June 19, 2023 01:31
zhangzujian added a commit to zhangzujian/kube-ovn that referenced this pull request Jun 19, 2023
zhangzujian added a commit to zhangzujian/kube-ovn that referenced this pull request Jun 19, 2023
zhangzujian added a commit to zhangzujian/kube-ovn that referenced this pull request Jun 19, 2023
zhangzujian added a commit to zhangzujian/kube-ovn that referenced this pull request Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New network feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resync network config between underlay interface and provider interface
2 participants