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

ovn-kube-util: provide bridges-to-nic subcommand #298

Merged
merged 1 commit into from
Apr 5, 2018

Conversation

girishmg
Copy link
Member

@girishmg girishmg commented Apr 3, 2018

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.

@openshift-ci-robot
Copy link

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

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.

Copy link
Contributor

@alinbalutoiu alinbalutoiu left a 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 {
Copy link
Contributor

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>
@girishmg
Copy link
Member Author

girishmg commented Apr 4, 2018

@alinbalutoiu updated the PR with the nit you suggested, so please take a look.

Copy link

@rajatchopra rajatchopra left a 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.

@rajatchopra
Copy link

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.

@rajatchopra
Copy link

Test ok.
Thanks.

@rajatchopra rajatchopra merged commit 3285284 into ovn-org:master Apr 5, 2018
@girishmg girishmg deleted the bridges_to_nic branch October 8, 2019 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants