underlay: fix ip/route tranfer when the nic is managed by NetworkManager #3184
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of this PR
Examples of user facing changes:
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
HOW
🤖 Generated by Copilot at c723486
configExternalBridge
andremoveProviderNic
functions methods of theController
struct, to improve modularity and testability (link, link, link, link, link)networkManagerSyncer
struct and its methods innm_linux.go
, to synchronize the IP addresses and routes of the host network interfaces with the OVS bridges (link)Run
method of thenetworkManagerSyncer
struct to subscribe to thePropertiesChanged
signals of theIP4Config
andIP6Config
interfaces, instead of theStateChanged
signal of theActiveConnection
interface, to better detect the changes in the IP addresses and routes of the devices (link, link, link)RemoveDevice
method of thenetworkManagerSyncer
struct to have no return value and to remove the redundant return statement, to simplify the code (link, link)transferAddrsAndRoutes
function inovs_linux.go
to use acount
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 thecount
variable is not zero, to avoid deleting the addresses and routes that were not transferred from the host nic (link, link, link, link)go.mod
file to use newer versions of thegithub.aaakk.us.kg/kubeovn/gonetworkmanager/v2
andgithub.aaakk.us.kg/google/uuid
modules (link, link)