Skip to content

Neutron v2: BGP Speaker Update and Add/Remove BGP Peer#2400

Merged
mandre merged 1 commit intogophercloud:masterfrom
shhgs:2022-05-10
May 20, 2022
Merged

Neutron v2: BGP Speaker Update and Add/Remove BGP Peer#2400
mandre merged 1 commit intogophercloud:masterfrom
shhgs:2022-05-10

Conversation

@shhgs
Copy link
Copy Markdown
Contributor

@shhgs shhgs commented May 11, 2022

Neutron V2: BGP Dynamic Routing
For #2208

$ git diff --stat HEAD^ 
 acceptance/openstack/networking/v2/extensions/bgp/peers/bgppeers_test.go       | 28 +++-------------------------
 acceptance/openstack/networking/v2/extensions/bgp/peers/peers.go               | 32 ++++++++++++++++++++++++++++++++
 acceptance/openstack/networking/v2/extensions/bgp/speakers/bgpspeakers_test.go | 89 +++++++++++++++++++++++++++++++++++++++++------------------------------------------------
 acceptance/openstack/networking/v2/extensions/bgp/speakers/speakers.go         | 38 ++++++++++++++++++++++++++++++++++++++
 openstack/networking/v2/extensions/bgp/speakers/doc.go                         | 42 ++++++++++++++++++++++++++++++++++++++++--
 openstack/networking/v2/extensions/bgp/speakers/requests.go                    | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 openstack/networking/v2/extensions/bgp/speakers/results.go                     | 41 +++++++++++++++++++++++++++++++++++++++++
 openstack/networking/v2/extensions/bgp/speakers/testing/fixture.go             | 33 +++++++++++++++++++++++++++++++++
 openstack/networking/v2/extensions/bgp/speakers/testing/requests_test.go       | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 openstack/networking/v2/extensions/bgp/speakers/urls.go                        | 15 +++++++++++++++
 10 files changed, 414 insertions(+), 78 deletions(-)

@shhgs
Copy link
Copy Markdown
Contributor Author

shhgs commented May 11, 2022

The OpenStack API doc for add_bgp_peer and remove_bgp_peer is wrong. I believe the correct URL can be found in the source code, check L69 and L80.

@shhgs
Copy link
Copy Markdown
Contributor Author

shhgs commented May 11, 2022

I finally decided to split the PR. There are still 3 methods that's not been done for bgp/speakers. And that shall come in the next PR.

  • /v2.0/bgp-speakers/{bgp-speaker-id}/get_advertised_routes
  • /v2.0/bgp-speakers/{bgp-speaker-id}/add_gateway_network
  • /v2.0/bgp-speakers/{bgp-speaker-id}/remove_gateway_network

@coveralls
Copy link
Copy Markdown

coveralls commented May 11, 2022

Coverage Status

Coverage increased (+0.01%) to 80.002% when pulling d9ceb5b on shhgs:2022-05-10 into 0ffab06 on gophercloud:master.

@shhgs
Copy link
Copy Markdown
Contributor Author

shhgs commented May 11, 2022

        }
3372
    convenience.go:236: Failure in mtu_test.go, line 132:at .Network.UpdatedAt expected time.Date(2022, time.May, 11, 3, 58, 51, 0, time.UTC), but got time.Date(2022, time.May, 11, 3, 58, 52, 0, time.UTC)
3373
    convenience.go:35: Failure in mtu_test.go, line 132: The structures were different.
3374
    networking.go:479: Attempting to delete network: a034f49a-cf12-440e-89bd-b66fd71408a5
3375
    networking.go:486: Deleted network: a034f49a-cf12-440e-89bd-b66fd71408a5

@shhgs shhgs force-pushed the 2022-05-10 branch 2 times, most recently from 400ebc6 to 2afba35 Compare May 11, 2022 16:58
t.Logf("Successfully added BGP Peer %s to BGP Speaker %s", bgpPeer.Name, speakerUpdated.Name)

// List BGP Speakers
allPages, err := speakers.List(client).AllPages()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not remove coverage for speakers.List().
You may want to use List() instead of Get() when checking the BGP Peer was correctly removed, and checking the speaker ID to validate we're looking at the right speaker.

@shhgs
Copy link
Copy Markdown
Contributor Author

shhgs commented May 16, 2022

Hi @mandre,

I've updated the PR.

  1. Rename the xxxOptBuilder to xxxOptsBuilder
  2. Using UpdateOptsBuilder, AddBGPPeerOptsBuilder and RemoveBGPPeerOptsBuilder instead of xxxOpts.
  3. move AddBGPPeerOpts to requests.go and also defined a RemoveBGPPeerOpts.

Copy link
Copy Markdown
Contributor

@mandre mandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, let's restore the coverage for speakers.List() and we should be good to merge.

@shhgs
Copy link
Copy Markdown
Contributor Author

shhgs commented May 20, 2022

@mandre

I forget to leave this test behind. I've added it back. Please check it out.

Copy link
Copy Markdown
Contributor

@mandre mandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, thanks for the quick update @shhgs. I see ussuri fails to install devstack, this has nothing to do with your patch, and since the other jobs all came back green, we have enough signals that your PR is good. LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants