-
Notifications
You must be signed in to change notification settings - Fork 334
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
ovn-kube-util: provide bridges-to-nic subcommand #298
Conversation
Hi @girishmg. Thanks for your PR. I'm waiting for a openshift or openvswitch member to verify that this patch is reasonable to test. If it is, they should reply with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall, just one minor nit.
return fmt.Sprintf("%s", brName[len("br"):]) | ||
} | ||
|
||
func saveIPAddress(oldLInk, newLink netlink.Link, addrs []netlink.Addr) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
's/oldLInk/oldLink/g'
This patch adds a subcommand bridges-to-nic to ovn-kube-util to restore back the NIC interface that was added to OVS bridge as part of gateway initialization. That is, given breth0 it moves the IP/routes associated with breth0 to eth0 and then deletes the OVS bridge breth0. I have renamed arguments to saveIPAddress(), delAddRoute(), and saveRoute() so that I could reuse those functions to bridges-to-nic. Signed-off-by: Girish Moodalbail <gmoodalbail@nvidia.com> Reviewed-by: Vit Yenukas <vity@nvidia.com>
@alinbalutoiu updated the PR with the nit you suggested, so please take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Thanks. This was a much needed utility.
I am going to test this and then merge.
Eventually we may even want these function to be used in a rollback operation. i.e. if nic-to-bridges fails at some point then call bridges-to-nic to restore things as much as possible. We may have to review the order of execution if that is desired. |
Test ok. |
This patch adds a subcommand bridges-to-nic to ovn-kube-util to restore back
the NIC interface that was added to OVS bridge as part of gateway
initialization. That is, given breth0 it moves the IP/routes associated with
breth0 to eth0 and then deletes the OVS bridge breth0.
I have renamed arguments to saveIPAddress(), delAddRoute(), and saveRoute()
so that I could reuse those functions to bridges-to-nic.